KubernetesIngressResource
Handle
interface KubernetesIngressResource extends IResource, IResourceWithParent, KubernetesEnvironmentResource]] { withDefaultBackend(endpoint: EndpointReference): KubernetesIngressResource; withHostname(hostname: string): KubernetesIngressResource; withIngressAnnotation( key: string, value: string): KubernetesIngressResource; withIngressAnnotationParam( key: string, value: ParameterResource): KubernetesIngressResource; withIngressClass(className: string): KubernetesIngressResource; withIngressClassParam(className: ParameterResource): KubernetesIngressResource; withIngressHostAndPath( host: string, path: string, endpoint: EndpointReference, pathType?: IngressPathType): KubernetesIngressResource; withIngressHostnameParam(hostname: ParameterResource): KubernetesIngressResource; withIngressPath( path: string, endpoint: EndpointReference, pathType?: IngressPathType): KubernetesIngressResource; withIngressTlsAuto(): KubernetesIngressResource; withIngressTlsParam(secretName: ParameterResource): KubernetesIngressResource; withTls(secretName: string): KubernetesIngressResource;}12 members
Methods
Sets the default backend for the ingress. The default backend handles requests that do not match any of the defined routing rules.
withDefaultBackend(endpoint: EndpointReference): KubernetesIngressResourceParameters
endpointEndpointReference The endpoint reference identifying the default backend service and port.Returns
KubernetesIngressResource Adds a hostname that this ingress matches. Multiple hostnames can be added by calling this method repeatedly. Path rules without an explicit host apply to each configured hostname. If no hostnames are configured, those rules match all hosts.
withHostname(hostname: string): KubernetesIngressResourceParameters
hostnamestringThe hostname to match (e.g., `"api.example.com"`).Returns
KubernetesIngressResource Adds a Kubernetes metadata annotation to the generated Ingress resource. These are key-value pairs in the `metadata.annotations` field of the K8S Ingress, commonly used to configure ingress controller-specific behavior.
withIngressAnnotation( key: string, value: string): KubernetesIngressResourceParameters
keystringThe annotation key (e.g., `"nginx.ingress.kubernetes.io/rewrite-target"`).valuestringThe annotation value.Returns
KubernetesIngressResource Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withIngressAnnotationParam( key: string, value: ParameterResource): KubernetesIngressResourceParameters
keystringThe annotation key.valueParameterResource A parameter resource builder for the annotation value.Returns
KubernetesIngressResource Sets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
withIngressClass(className: string): KubernetesIngressResourceParameters
className stringThe ingress class name (e.g., `"nginx"`, `"traefik"`, `"azure-alb-external"`).Returns
KubernetesIngressResource Sets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
withIngressClassParam(className: ParameterResource): KubernetesIngressResourceParameters
className ParameterResource A parameter resource builder for the ingress class name.Returns
KubernetesIngressResource Adds a host-scoped path rule to the ingress. The rule matches traffic for the specified host and path, forwarding it to the given endpoint's backing Kubernetes service.
withIngressHostAndPath( host: string, path: string, endpoint: EndpointReference, pathType?: IngressPathType): KubernetesIngressResourceParameters
hoststringThe hostname to match (e.g., `"api.example.com"`).pathstringThe URL path to match (e.g., `"/"` or `"/api"`). Must start with `/`.endpointEndpointReference The endpoint reference identifying the target service and port.pathType IngressPathType optional= PrefixThe path matching strategy. Defaults to `Prefix`.Returns
KubernetesIngressResource Adds a hostname using a parameter that will be resolved at deploy time.
withIngressHostnameParam(hostname: ParameterResource): KubernetesIngressResourceParameters
hostnameParameterResource A parameter resource builder for the hostname value.Returns
KubernetesIngressResource Adds a path-based rule to the ingress. The rule matches each hostname configured with `WithHostname`, or all hosts when no hostname is configured, and forwards matching traffic to the endpoint's backing Kubernetes service.
withIngressPath( path: string, endpoint: EndpointReference, pathType?: IngressPathType): KubernetesIngressResourceParameters
pathstringThe URL path to match (e.g., `"/"` or `"/api"`). Must start with `/`.endpointEndpointReference The endpoint reference identifying the target service and port.pathType IngressPathType optional= PrefixThe path matching strategy. Defaults to `Prefix`.Returns
KubernetesIngressResource Configures TLS termination with an auto-generated secret name derived from the ingress name.
withIngressTlsAuto(): KubernetesIngressResourceReturns
KubernetesIngressResource Configures TLS termination using a parameter for the secret name.
withIngressTlsParam(secretName: ParameterResource): KubernetesIngressResourceParameters
secretName ParameterResource A parameter resource builder for the secret name.Returns
KubernetesIngressResource Configures TLS for a Kubernetes Ingress using a K8S secret
withTls(secretName: string): KubernetesIngressResourceParameters
secretName stringThe name of the Kubernetes `kubernetes.io/tls` Secret.Returns
KubernetesIngressResource