Skip to content
Docs Try Aspire
Docs Try

KubernetesGatewayExtensions

Class static net8.0
📦 Aspire.Hosting.Kubernetes v13.3.0-preview.1.26254.5
Provides extension methods for configuring Kubernetes Gateway API resources in the Aspire application model.
namespace Aspire.Hosting;
public static class KubernetesGatewayExtensions
{
// ...
}
AddGateway(IResourceBuilder<KubernetesEnvironmentResource>, string)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Adds a Kubernetes Gateway API Gateway resource to the application model as a child of the specified Kubernetes environment. The gateway generates a gateway.networking.k8s.io/v1 Gateway resource and one or more HTTPRoute resources in the Helm chart output at publish time.
WithGatewayAnnotation(IResourceBuilder<KubernetesGatewayResource>, string, string)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Adds a Kubernetes metadata annotation to the generated Gateway resource.
WithGatewayAnnotation(IResourceBuilder<KubernetesGatewayResource>, string, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
WithGatewayClass(IResourceBuilder<KubernetesGatewayResource>, string)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Sets the GatewayClass name that selects which controller implementation handles this gateway.
WithGatewayClass(IResourceBuilder<KubernetesGatewayResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Sets the GatewayClass name using a parameter that will be resolved at deploy time.
WithHostname(IResourceBuilder<KubernetesGatewayResource>, string)extensionats export
IResourceBuilder<KubernetesGatewayResource>
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(IResourceBuilder<KubernetesGatewayResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Adds a hostname using a parameter that will be resolved at deploy time.
WithRoute(IResourceBuilder<KubernetesGatewayResource>, string, EndpointReference, IngressPathType)extensionats export
IResourceBuilder<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.
WithRoute(IResourceBuilder<KubernetesGatewayResource>, string, string, EndpointReference, IngressPathType)extensionats export
IResourceBuilder<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.
WithTls(IResourceBuilder<KubernetesGatewayResource>, string)extensionats export
IResourceBuilder<KubernetesGatewayResource>
WithTls(IResourceBuilder<KubernetesGatewayResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Configures TLS termination using a parameter for the secret name.
WithTls(IResourceBuilder<KubernetesGatewayResource>)extensionats export
IResourceBuilder<KubernetesGatewayResource>
Configures TLS termination with an auto-generated secret name derived from the gateway name.
View all methods