KubernetesGatewayResource
Handle
interface KubernetesGatewayResource extends IResource, IResourceWithParent, KubernetesEnvironmentResource]] { withGatewayAnnotation( key: string, value: string): KubernetesGatewayResource; withGatewayAnnotationParam( key: string, value: ParameterResource): KubernetesGatewayResource; withGatewayClass(className: string): KubernetesGatewayResource; withGatewayClassParam(className: ParameterResource): KubernetesGatewayResource; withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResource; withGatewayHostRoute( host: string, path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResource; withGatewayPathRoute( path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResource; withGatewayTlsAuto(): KubernetesGatewayResource; withGatewayTlsIssuer(issuer: CertManagerIssuerResource): KubernetesGatewayResource; withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResource; withHostname(hostname: string): KubernetesGatewayResource; withTls(secretName: string): KubernetesGatewayResource;}12 members
Methods
Adds a Kubernetes metadata annotation to the generated Gateway resource.
withGatewayAnnotation( key: string, value: string): KubernetesGatewayResourceParameters
keystringThe annotation key.valuestringThe annotation value.Returns
KubernetesGatewayResource Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withGatewayAnnotationParam( key: string, value: ParameterResource): KubernetesGatewayResourceParameters
keystringThe annotation key.valueParameterResource A parameter resource builder for the annotation value.Returns
KubernetesGatewayResource Sets the GatewayClass name that selects which controller implementation handles this gateway.
withGatewayClass(className: string): KubernetesGatewayResourceParameters
className stringThe GatewayClass name (e.g., `"azure-alb-external"`, `"istio"`).Returns
KubernetesGatewayResource Sets the GatewayClass name using a parameter that will be resolved at deploy time.
withGatewayClassParam(className: ParameterResource): KubernetesGatewayResourceParameters
className ParameterResource A parameter resource builder for the GatewayClass name.Returns
KubernetesGatewayResource Adds a hostname using a parameter that will be resolved at deploy time.
withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResourceParameters
hostnameParameterResource A parameter resource builder for the hostname value.Returns
KubernetesGatewayResource Adds a host-and-path-based routing rule to the gateway. The rule matches traffic for the specified host and path, routing it to the given endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource with a `hostnames` filter.
withGatewayHostRoute( host: string, path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResourceParameters
hoststringThe hostname to match (e.g., `"api.example.com"`).pathstringThe URL path to match. Must start with `/`.endpointEndpointReference The endpoint reference identifying the target service and port.pathType GatewayPathMatchType optional= PathPrefixThe path matching strategy. Defaults to `PathPrefix`.Returns
KubernetesGatewayResource Adds a path-based routing rule to the gateway. The rule matches each hostname configured with `WithHostname`, or all hosts when no hostname is configured, and routes matching traffic to the endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource attached to the Gateway.
withGatewayPathRoute( path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResourceParameters
pathstringThe URL path to match (e.g., `"/"` or `"/api"`). Must start with `/`.endpointEndpointReference The endpoint reference identifying the target service and port.pathType GatewayPathMatchType optional= PathPrefixThe path matching strategy. Defaults to `PathPrefix`.Returns
KubernetesGatewayResource Configures TLS termination with an auto-generated secret name derived from the gateway name.
withGatewayTlsAuto(): KubernetesGatewayResourceReturns
KubernetesGatewayResource Adds an HTTPS listener to the gateway and wires it to the supplied cert-manager `ClusterIssuer`. This adds the `cert-manager.io/cluster-issuer` annotation to the generated Gateway resource, causing cert-manager to provision and renew a certificate for each gateway listener hostname.
withGatewayTlsIssuer(issuer: CertManagerIssuerResource): KubernetesGatewayResourceParameters
issuerCertManagerIssuerResource The cert-manager `ClusterIssuer` to issue certificates from.Returns
KubernetesGatewayResource Configures TLS termination using a parameter for the secret name.
withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResourceParameters
secretName ParameterResource A parameter resource builder for the secret name.Returns
KubernetesGatewayResource Adds a hostname that this gateway's routes match. Multiple hostnames can be added by calling this method repeatedly. Routes without an explicit host apply to each configured hostname. Hostnames are used as `hostnames` in generated `HTTPRoute` resources and as HTTPS listener hostnames when TLS is configured.
withHostname(hostname: string): KubernetesGatewayResourceParameters
hostnamestringThe hostname to match (e.g., `"api.example.com"`).Returns
KubernetesGatewayResource Configures TLS on a Kubernetes Gateway listener
withTls(secretName: string): KubernetesGatewayResourceParameters
secretName stringThe name of the Kubernetes `kubernetes.io/tls` Secret.Returns
KubernetesGatewayResource