Create a custom gateway
What you’ll accomplish
Section titled “What you’ll accomplish”After completing this guide, you will have a custom Istio gateway running alongside the standard UDS Core gateways. Custom gateways are useful when you need separate domain routing, different TLS settings, specialized security controls, or IP-based access restrictions that don’t fit the tenant or admin gateways.
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with UDS Core deployed
- Familiarity with Zarf packages and Helm charts
- Familiarity with UDS Bundles
Before you begin
Section titled “Before you begin”UDS Core requires specific naming conventions for custom gateways. If these are not followed exactly, the UDS Operator will not be able to route traffic through your gateway.
For a gateway named custom:
| Resource | Required naming |
|---|---|
| Helm release name | custom-ingressgateway |
| Namespace | istio-custom-gateway |
Config chart name value | custom |
Two keywords alter gateway behavior when included in the name:
admin(e.g.,custom-admin): The gateway defaults to the admin domain for allexposeentriespassthrough(e.g.,custom-passthrough): An extra SNI host match is added for allexposeentries
-
Create a Zarf package for the gateway
Your Zarf package needs two charts: the upstream Istio gateway chart (for the actual deployment and load balancer) and the UDS Core gateway config chart (for the Gateway CR and TLS secrets).
zarf.yaml kind: ZarfPackageConfigmetadata:name: custom-gatewaydescription: "Custom gateway for UDS Core"components:- name: istio-custom-gatewayrequired: truecharts:- name: gatewayurl: https://istio-release.storage.googleapis.com/chartsversion: x.x.x # Should match the Istio version in UDS CorereleaseName: custom-ingressgatewaynamespace: istio-custom-gateway- name: uds-istio-configversion: x.x.x # Should match the UDS Core versionurl: https://github.com/defenseunicorns/uds-core.gitgitPath: src/istio/charts/uds-istio-confignamespace: istio-custom-gatewayvaluesFiles:- "config-custom.yaml" -
Configure the gateway values
Create the values file with your gateway configuration. At minimum, provide the name, domain, and TLS mode:
config-custom.yaml name: customdomain: mydomain.devtls:servers:custom:mode: SIMPLE # One of: SIMPLE, MUTUAL, OPTIONAL_MUTUAL, PASSTHROUGHSee the default values file for all available configuration options.
-
Provide TLS certificates
For gateways that are not in
PASSTHROUGHmode, supply a TLS certificate and key. Expose these as variables in your bundle:uds-bundle.yaml packages:- name: custom-gateway...overrides:istio-custom-gateway:uds-istio-config:variables:- name: CUSTOM_TLS_CERTdescription: "The TLS cert for the custom gateway (must be base64 encoded)"path: tls.cert- name: CUSTOM_TLS_KEYdescription: "The TLS key for the custom gateway (must be base64 encoded)"path: tls.keysensitive: trueAlternatively, reference an existing Kubernetes secret:
uds-bundle.yaml packages:- name: custom-gateway...overrides:istio-custom-gateway:uds-istio-config:values:- path: tls.credentialNamevalue: custom-gateway-tls-secret -
Expose a service through the custom gateway
Use the custom gateway name in your Package CR to route traffic through it:
uds-package.yaml apiVersion: uds.dev/v1alpha1kind: Packagemetadata:name: my-appnamespace: my-appspec:network:expose:- service: my-appselector:app.kubernetes.io/name: my-appgateway: customdomain: mydomain.devhost: my-appport: 8080Set
domainif the custom gateway’s domain differs from your environment’s default domain. Thegatewayvalue must match thenamein your gateway config (customin this example). -
Create and deploy your bundle
Terminal window uds create --confirm && uds deploy uds-bundle-*.tar.zst --confirm
Verification
Section titled “Verification”Check that the Package CR was reconciled and shows the expected endpoints:
uds zarf tools kubectl get package my-app -n my-appThe ENDPOINTS column should show your application’s URL. Test access:
curl -v https://my-app.mydomain.devTroubleshooting
Section titled “Troubleshooting”Traffic not routing through the custom gateway
Section titled “Traffic not routing through the custom gateway”Symptoms: Package CR reconciles but traffic doesn’t reach the service.
Solution: Verify naming conventions match exactly:
- Release name:
<name>-ingressgateway - Namespace:
istio-<name>-gateway - Config
name:<name>
A mismatch in any of these will prevent the Package CR from connecting to your gateway.
TLS errors on non-passthrough gateway
Section titled “TLS errors on non-passthrough gateway”Symptoms: TLS handshake failures when accessing services.
Solution: Ensure you have provided TLS certificates for the gateway. Gateways in SIMPLE, MUTUAL, or OPTIONAL_MUTUAL mode require a valid cert and key.
Related documentation
Section titled “Related documentation”Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: