Expose applications on gateways
What you’ll accomplish
Section titled “What you’ll accomplish”After completing this guide, your application will be accessible through one of UDS Core’s ingress gateways — either the tenant gateway (for end-user applications) or the admin gateway (for admin-facing interfaces).
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with UDS Core deployed and TLS configured — see Configure TLS certificates
- A domain configured in your
uds-config.yaml:uds-config.yaml shared:domain: yourdomain.comadmin_domain: admin.yourdomain.com # optional, defaults to admin.<domain> - Wildcard DNS records for
*.yourdomain.comand*.admin.yourdomain.compointing to the tenant and admin gateway load balancer IPs - Familiarity with Zarf packages
-
Define a Package CR for your application
Add an
exposeentry to route traffic through a gateway. The UDS Operator creates the necessaryVirtualServiceandAuthorizationPolicyresources automatically.To expose on the tenant gateway (end-user traffic):
uds-package.yaml apiVersion: uds.dev/v1alpha1kind: Packagemetadata:name: my-appnamespace: my-appspec:network:expose:- service: my-app-serviceselector:app.kubernetes.io/name: my-apphost: my-appgateway: tenantport: 8080This exposes the application at
https://my-app.yourdomain.com, routing traffic to port 8080 on pods matching the selector.To expose on the admin gateway (admin-facing interfaces), use
gateway: admin:uds-package.yaml apiVersion: uds.dev/v1alpha1kind: Packagemetadata:name: my-appnamespace: my-appspec:network:expose:- service: my-app-adminselector:app.kubernetes.io/name: my-apphost: my-appgateway: adminport: 9090This exposes the application at
https://my-app.admin.yourdomain.com. Since the admin and tenant gateways are logically separated, you can apply different security controls to each (IP allowlisting, mTLS client certificates, etc.). -
Build and deploy your Zarf package
Include the
PackageCR manifest in your Zarf package alongside your application’s Helm chart. Then build and deploy:Terminal window uds zarf package create --confirm && uds zarf package deploy zarf-package-*.tar.zst --confirmIf your application is part of a UDS Bundle, include the Zarf package in your bundle and deploy it with
uds createanduds deployinstead.
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(s). Test access:
curl -v https://my-app.yourdomain.comExpose a service on the root (apex) domain
Section titled “Expose a service on the root (apex) domain”By default, UDS Core gateways use wildcard hosts (e.g., *.yourdomain.com), which match subdomains but not the root domain itself. To serve traffic at https://yourdomain.com, enable root domain support.
-
Enable the root domain in your bundle
uds-bundle.yaml packages:- name: corerepository: registry.defenseunicorns.com/public/coreref: x.x.x-upstreamoverrides:istio-tenant-gateway:uds-istio-config:values:- path: rootDomain.enabledvalue: true- path: rootDomain.tls.modevalue: SIMPLE- path: rootDomain.tls.credentialNamevalue: "" # Leave blank to auto-create the secret from cert data- path: rootDomain.tls.supportTLSV1_2value: truevariables:- path: rootDomain.tls.certname: "ROOT_TLS_CERT"- path: rootDomain.tls.keyname: "ROOT_TLS_KEY"sensitive: true- path: rootDomain.tls.cacertname: "ROOT_TLS_CACERT" -
Expose your service using the
.hostuds-package.yaml apiVersion: uds.dev/v1alpha1kind: Packagemetadata:name: my-appnamespace: my-namespacespec:network:expose:- service: my-app-serviceselector:app.kubernetes.io/name: my-apphost: "."gateway: tenantport: 80Ensure your DNS has an A record for the root domain pointing to your ingress gateway.
-
Create and deploy your bundle and application
Deploy the UDS Core bundle with the root domain overrides:
Terminal window uds create --confirm && uds deploy uds-bundle-*.tar.zst --confirmThen build and deploy your application’s Zarf package (which includes the Package CR):
Terminal window uds zarf package create --confirm && uds zarf package deploy zarf-package-*.tar.zst --confirm
Troubleshooting
Section titled “Troubleshooting”Service not reachable
Section titled “Service not reachable”Symptoms: Browser or curl returns connection refused or timeout.
Solution:
- Verify the Package CR was reconciled:
uds zarf tools kubectl get package my-app -n my-app— check theSTATUScolumn - Ensure your DNS resolves the hostname to the gateway load balancer IP
Wrong gateway or domain
Section titled “Wrong gateway or domain”Symptoms: Application accessible on an unexpected URL or not at all.
Solution:
- Check the
gatewayfield in your Package CR matches your intent (tenantoradmin) - Verify the
hostfield — it becomes the subdomain prefix (e.g.,host: my-app→my-app.yourdomain.com) - Check
shared.domainin youruds-config.yaml
Root domain not working
Section titled “Root domain not working”Symptoms: Subdomains work but https://yourdomain.com does not.
Solution:
- Confirm
rootDomain.enabledis set totruein your bundle overrides - Verify DNS has an A record for the root domain (not just a wildcard)
- Check that TLS certificates are provided for the root domain configuration
Related documentation
Section titled “Related documentation”Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: