Skip to content

K8sIngress

K8sIngress creates a Kubernetes Ingress in the target cluster. Ingress resources define HTTP/S routing rules from external clients to internal services, with optional TLS termination.

Property Type Required Description
host string Virtual hostname (e.g., api.example.com)
paths { path: string; pathType?: string; service: K8sService | string; port?: number }[] Path routing rules
Property Type Required Description
hosts string[] Hostnames covered by the certificate
secretName string Kubernetes Secret name holding the TLS certificate
Property Type Required Description
cluster KubernetesCluster | string Target cluster
namespace K8sNamespace | string Namespace to create the Ingress in
dependsOn string[] Explicit dependency ordering
rules IngressRule[] HTTP/S routing rules
tls IngressTLS[] TLS configuration
ingressClassName string IngressClass name (e.g., nginx, traefik)
annotations Record<string, string> Ingress annotations (controller-specific config)
spec Record<string, unknown> Raw spec overrides
const appIngress = new K8sIngress({
name: 'app-ingress',
cluster: myCluster,
namespace: myNamespace,
ingressClassName: 'nginx',
rules: [
{
host: 'app.example.com',
paths: [
{ path: '/', pathType: 'Prefix', service: apiService, port: 80 },
{ path: '/static', pathType: 'Prefix', service: staticService, port: 8080 },
],
},
],
tls: [
{ hosts: ['app.example.com'], secretName: 'app-tls' },
],
annotations: {
'nginx.ingress.kubernetes.io/ssl-redirect': 'true',
},
})
Provider Supported
Kubernetes
Hetzner
DigitalOcean
AWS
GCP