Set up non-HTTP ingress
What you’ll accomplish
Section titled “What you’ll accomplish”After completing this guide, your cluster will accept non-HTTP traffic (such as SSH) through an Istio gateway, routed to your application service.
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with UDS Core deployed
- An application with a service listening on a TCP port
This example configures SSH ingress, but the same process applies to any TCP protocol.
-
Add the port to the gateway load balancer
Configure the gateway’s load balancer service in your UDS Core bundle to accept traffic on your custom port:
uds-bundle.yaml packages:- name: corerepository: registry.defenseunicorns.com/public/coreref: x.x.x-upstreamoverrides:istio-tenant-gateway:gateway:values:- path: "service.ports"value:# Default ports — you MUST include these- name: status-portport: 15021protocol: TCPtargetPort: 15021- name: http2port: 80protocol: TCPtargetPort: 80- name: httpsport: 443protocol: TCPtargetPort: 443# Your custom port- name: tcp-sshport: 2022 # External port exposed on the load balancerprotocol: TCPtargetPort: 22 # Port on the gateway pod -
Create and deploy your UDS Core bundle
Terminal window uds create --confirm && uds deploy uds-bundle-*.tar.zst --confirm -
Create an Istio Gateway resource
In your application’s Zarf package, create a Gateway CR that tells Istio to listen on the new port for your host:
gateway.yaml apiVersion: networking.istio.io/v1beta1kind: Gatewaymetadata:name: example-ssh-gatewaynamespace: istio-tenant-gateway # Must match the gateway's namespacespec:selector:app: tenant-ingressgatewayservers:- hosts:- example.uds.dev # The host to accept connections forport:name: tcp-sshnumber: 22 # Must match the targetPort from step 1protocol: TCP -
Create a VirtualService to route traffic
Route incoming TCP traffic from the gateway to your application service:
virtualservice.yaml apiVersion: networking.istio.io/v1beta1kind: VirtualServicemetadata:name: example-sshnamespace: example # Your application's namespacespec:gateways:- istio-tenant-gateway/example-ssh-gateway # namespace/name of the Gatewayhosts:- example.uds.devtcp:- match:- port: 22 # Must match the Gateway port numberroute:- destination:host: example.example.svc.cluster.local # Full service addressport:number: 22 # Port on the destination service -
Add a network policy via the Package CR
UDS Core enforces strict network policies by default. Allow ingress from the gateway in your Package CR:
uds-package.yaml apiVersion: uds.dev/v1alpha1kind: Packagemetadata:name: examplenamespace: examplespec:network:allow:- direction: Ingressselector:app: exampleremoteNamespace: istio-tenant-gatewayremoteSelector:app: tenant-ingressgatewayport: 22description: "SSH Ingress" -
Build and deploy your application’s Zarf package
Include the Gateway, VirtualService, and Package CR manifests in your Zarf package, then build and deploy:
Terminal window uds zarf package create --confirm && uds zarf package deploy zarf-package-*.tar.zst --confirm
Verification
Section titled “Verification”Test the connection:
ssh -p 2022 user@example.uds.devFor other protocols, test with the appropriate client on the external port you configured (2022 in this example).
Troubleshooting
Section titled “Troubleshooting”Connection refused
Section titled “Connection refused”Symptoms: Client receives “connection refused” immediately.
Solution:
- Verify the load balancer service has the port configured:
uds zarf tools kubectl get svc -n istio-tenant-gateway - Check that the Gateway CR exists:
uds zarf tools kubectl get gateway -n istio-tenant-gateway - Confirm
targetPortin the service matchesport.numberin the Gateway CR
Connection timeout
Section titled “Connection timeout”Symptoms: Client hangs without a response.
Solution:
- Check the VirtualService route matches the Gateway port and host
- Verify the network policy allows ingress from the gateway namespace:
uds zarf tools kubectl get package example -n example - Confirm the destination service and port are correct:
uds zarf tools kubectl get svc -n example
Related documentation
Section titled “Related documentation”Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: