Skip to content

Configure TLS certificates for gateways

After completing this guide, your UDS Core ingress gateways will serve traffic using valid TLS certificates for your domain.

  • 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

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.

  1. Define TLS variables in your bundle

    uds-bundle.yaml
    kind: UDSBundle
    metadata:
    name: my-uds-core
    description: UDS Core with custom TLS certificates
    version: "0.0.1"
    packages:
    - name: core
    repository: registry.defenseunicorns.com/public/core
    ref: x.x.x-upstream
    overrides:
    istio-admin-gateway:
    uds-istio-config:
    variables:
    - name: ADMIN_TLS_CERT
    description: "The TLS cert for the admin gateway (must be base64 encoded)"
    path: tls.cert
    - name: ADMIN_TLS_KEY
    description: "The TLS key for the admin gateway (must be base64 encoded)"
    path: tls.key
    sensitive: true
    istio-tenant-gateway:
    uds-istio-config:
    variables:
    - name: TENANT_TLS_CERT
    description: "The TLS cert for the tenant gateway (must be base64 encoded)"
    path: tls.cert
    - name: TENANT_TLS_KEY
    description: "The TLS key for the tenant gateway (must be base64 encoded)"
    path: tls.key
    sensitive: true
  2. 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
  3. Create and deploy your bundle

    Terminal window
    uds create --confirm && uds deploy uds-bundle-*.tar.zst --confirm

If you have enabled root (apex) domain support, provide TLS certificates separately for the root domain:

uds-bundle.yaml
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"

UDS Core gateways default to TLS 1.3 only. If clients require TLS 1.2, enable it per gateway:

uds-bundle.yaml
overrides:
istio-tenant-gateway:
uds-istio-config:
values:
- path: tls.supportTLSV1_2
value: true

Test the certificate chain:

Terminal window
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.

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.

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:

Terminal window
base64 -w0 < my-cert.pem # Linux
base64 -i my-cert.pem | tr -d '\n' # macOS

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.

These guides and concepts may be useful to explore next: