Skip to content
DocsTry Aspire
DocsTry

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
keystring
valuestring
KubernetesGatewayResource
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withGatewayAnnotationParam(
key: string,
value: ParameterResource): KubernetesGatewayResource
keystring
valueParameterResource
KubernetesGatewayResource
methodwithGatewayClassbuilder
Sets the GatewayClass name that selects which controller implementation handles this gateway.
withGatewayClass(className: string): KubernetesGatewayResource
classNamestring
KubernetesGatewayResource
Sets the GatewayClass name using a parameter that will be resolved at deploy time.
withGatewayClassParam(className: ParameterResource): KubernetesGatewayResource
classNameParameterResource
KubernetesGatewayResource
Adds a hostname using a parameter that will be resolved at deploy time.
withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResource
hostnameParameterResource
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): KubernetesGatewayResource
hoststring
pathstring
endpointEndpointReference
pathTypeGatewayPathMatchTypeoptional= PathPrefix
KubernetesGatewayResource
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
pathstring
endpointEndpointReference
pathTypeGatewayPathMatchTypeoptional= PathPrefix
KubernetesGatewayResource
methodwithGatewayTlsAutobuilder
Configures TLS termination with an auto-generated secret name derived from the gateway name.
withGatewayTlsAuto(): KubernetesGatewayResource
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): KubernetesGatewayResource
issuerCertManagerIssuerResource
KubernetesGatewayResource
methodwithGatewayTlsParambuilder
Configures TLS termination using a parameter for the secret name.
withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResource
secretNameParameterResource
KubernetesGatewayResource
methodwithHostnamebuilder
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
hostnamestring
KubernetesGatewayResource
methodwithTlsbuilder
Configures TLS on a Kubernetes Gateway listener
withTls(secretName: string): KubernetesGatewayResource
secretNamestring
KubernetesGatewayResource