Configure TLS certificates for gateways
What you’ll accomplish
Section titled “What you’ll accomplish”After completing this guide, your UDS Core ingress gateways will serve traffic using valid TLS certificates for your domain.
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with prerequisites met
- A wildcard TLS certificate and private key (PEM format) for each gateway domain. If using a private or non-public CA, the root CA must be loaded in your OS trust store for browser and CLI verification to work.
- Tenant gateway:
*.yourdomain.com - Admin gateway:
*.admin.yourdomain.com(or your custom admin domain) - Root domain (optional):
yourdomain.com— only needed if you expose a service on the root domain
- Tenant gateway:
Before you begin
Section titled “Before you begin”Provide certificates
Section titled “Provide certificates”Use this approach when you want to supply certificates at deploy time via environment variables or uds-config.yaml. This is the most common approach.
-
Define TLS variables in your bundle
uds-bundle.yaml kind: UDSBundlemetadata:name: my-uds-coredescription: UDS Core with custom TLS certificatesversion: "0.0.1"packages:- name: corerepository: registry.defenseunicorns.com/public/coreref: x.x.x-upstreamoverrides:istio-admin-gateway:uds-istio-config:variables:- name: ADMIN_TLS_CERTdescription: "The TLS cert for the admin gateway (must be base64 encoded)"path: tls.cert- name: ADMIN_TLS_KEYdescription: "The TLS key for the admin gateway (must be base64 encoded)"path: tls.keysensitive: trueistio-tenant-gateway:uds-istio-config:variables:- name: TENANT_TLS_CERTdescription: "The TLS cert for the tenant gateway (must be base64 encoded)"path: tls.cert- name: TENANT_TLS_KEYdescription: "The TLS key for the tenant gateway (must be base64 encoded)"path: tls.keysensitive: true -
Supply the values in your config
You can set values via
uds-config.yaml:uds-config.yaml variables:core:admin_tls_cert: <base64-encoded-cert>admin_tls_key: <base64-encoded-key>tenant_tls_cert: <base64-encoded-cert>tenant_tls_key: <base64-encoded-key>Or via environment variables at deploy time:
Terminal window UDS_ADMIN_TLS_CERT=<base64-encoded-cert> \UDS_ADMIN_TLS_KEY=<base64-encoded-key> \UDS_TENANT_TLS_CERT=<base64-encoded-cert> \UDS_TENANT_TLS_KEY=<base64-encoded-key> \uds deploy my-bundle.tar.zst --confirm -
Create and deploy your bundle
Terminal window uds create --confirm && uds deploy uds-bundle-*.tar.zst --confirm
Use this approach when you already have TLS secrets in your cluster (e.g., managed by cert-manager or an external secrets operator). The tls.credentialName value overrides tls.cert, tls.key, and tls.cacert.
Reference the secrets in your bundle:
packages: - name: core repository: registry.defenseunicorns.com/public/core ref: x.x.x-upstream overrides: istio-admin-gateway: uds-istio-config: values: - path: tls.credentialName value: admin-gateway-tls-secret istio-tenant-gateway: uds-istio-config: values: - path: tls.credentialName value: tenant-gateway-tls-secretThe secret must exist in the same namespace as the gateway resource. See Istio Gateway ServerTLSSettings for the required secret keys.
Create and deploy:
uds create --confirm && uds deploy uds-bundle-*.tar.zst --confirmRoot domain TLS certificates
Section titled “Root domain TLS certificates”If you have enabled root (apex) domain support, provide TLS certificates separately for the root domain:
overrides: istio-tenant-gateway: uds-istio-config: variables: - path: rootDomain.tls.cert name: "ROOT_TLS_CERT" - path: rootDomain.tls.key name: "ROOT_TLS_KEY" sensitive: true - path: rootDomain.tls.cacert name: "ROOT_TLS_CACERT"Enable TLS 1.2 support
Section titled “Enable TLS 1.2 support”UDS Core gateways default to TLS 1.3 only. If clients require TLS 1.2, enable it per gateway:
overrides: istio-tenant-gateway: uds-istio-config: values: - path: tls.supportTLSV1_2 value: trueVerification
Section titled “Verification”Test the certificate chain:
curl -v https://my-app.yourdomain.com 2>&1 | grep -A 5 "Server certificate"You should see your domain certificate and the correct certificate chain. You can also inspect the certificate in a browser by clicking the lock icon in the address bar.
Troubleshooting
Section titled “Troubleshooting”Certificate chain errors
Section titled “Certificate chain errors”Symptoms: Browsers show “certificate not trusted” or curl reports SSL certificate problem: unable to get local issuer certificate.
Solution: Ensure your certificate bundle includes the full chain in the correct order: server cert first, then intermediates, then root CA.
Base64 encoding issues
Section titled “Base64 encoding issues”Symptoms: Gateway pods fail to start or TLS handshake fails immediately.
Solution: Verify your certificate and key values are properly base64 encoded. The values should be the base64 encoding of the PEM file contents:
base64 -w0 < my-cert.pem # Linuxbase64 -i my-cert.pem | tr -d '\n' # macOSTLS 1.2 clients can’t connect
Section titled “TLS 1.2 clients can’t connect”Symptoms: Older clients or tools fail to connect, newer clients work fine.
Solution: Enable TLS 1.2 support as shown above. This is common in environments with legacy systems or specific compliance requirements.
Related documentation
Section titled “Related documentation”Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: