Skip to content
Docs Try Aspire
Docs Try

KubernetesGatewayResource

Handle
📦 Aspire.Hosting.Kubernetes v13.4.0-preview.1.26281.18
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;
}

Methods

Adds a Kubernetes metadata annotation to the generated Gateway resource.
withGatewayAnnotation(
key: string,
value: string): KubernetesGatewayResource
key string
value string
KubernetesGatewayResource
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withGatewayAnnotationParam(
key: string,
value: ParameterResource): KubernetesGatewayResource
key string
value ParameterResource
KubernetesGatewayResource
method withGatewayClass builder
Sets the GatewayClass name that selects which controller implementation handles this gateway.
withGatewayClass(className: string): KubernetesGatewayResource
className string
KubernetesGatewayResource
Sets the GatewayClass name using a parameter that will be resolved at deploy time.
withGatewayClassParam(className: ParameterResource): KubernetesGatewayResource
className ParameterResource
KubernetesGatewayResource
Adds a hostname using a parameter that will be resolved at deploy time.
withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResource
hostname ParameterResource
KubernetesGatewayResource
method withGatewayHostRoute builder
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): KubernetesGatewayResource
host string
path string
endpoint EndpointReference
pathType GatewayPathMatchType optional = PathPrefix
KubernetesGatewayResource
method withGatewayPathRoute builder
Adds a path-based routing rule to the gateway. The rule matches all hosts and routes traffic matching the specified path to the given endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource attached to the Gateway.
withGatewayPathRoute(
path: string,
endpoint: EndpointReference,
pathType?: GatewayPathMatchType): KubernetesGatewayResource
path string
endpoint EndpointReference
pathType GatewayPathMatchType optional = PathPrefix
KubernetesGatewayResource
method withGatewayTlsAuto builder
Configures TLS termination with an auto-generated secret name derived from the gateway name.
withGatewayTlsAuto(): KubernetesGatewayResource
KubernetesGatewayResource
method withGatewayTlsIssuer builder
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): KubernetesGatewayResource
issuer CertManagerIssuerResource
KubernetesGatewayResource
method withGatewayTlsParam builder
Configures TLS termination using a parameter for the secret name.
withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResource
secretName ParameterResource
KubernetesGatewayResource
method withHostname builder
Adds a hostname that this gateway's routes match. Multiple hostnames can be added by calling this method repeatedly. Hostnames are used as `hostnames` in generated `HTTPRoute` resources and as HTTPS listener hostnames when TLS is configured.
withHostname(hostname: string): KubernetesGatewayResource
hostname string
KubernetesGatewayResource
method withTls builder
Configures TLS on a Kubernetes Gateway listener
withTls(secretName: string): KubernetesGatewayResource
secretName string
KubernetesGatewayResource