Skip to content
Docs Try Aspire
Docs Try

KubernetesIngressExtensions

Class static net8.0
📦 Aspire.Hosting.Kubernetes v13.3.0-preview.1.26254.5
Provides extension methods for configuring Kubernetes Ingress resources in the Aspire application model.
namespace Aspire.Hosting;
public static class KubernetesIngressExtensions
{
// ...
}
AddIngress(IResourceBuilder<KubernetesEnvironmentResource>, string)extensionats export
IResourceBuilder<KubernetesIngressResource>
Adds a Kubernetes Ingress resource to the application model as a child of the specified Kubernetes environment. The ingress generates a networking.k8s.io/v1 Ingress resource in the Helm chart output at publish time.
WithDefaultBackend(IResourceBuilder<KubernetesIngressResource>, EndpointReference)extensionats export
IResourceBuilder<KubernetesIngressResource>
Sets the default backend for the ingress. The default backend handles requests that do not match any of the defined routing rules.
WithHostname(IResourceBuilder<KubernetesIngressResource>, string)extensionats export
IResourceBuilder<KubernetesIngressResource>
Adds a hostname that this ingress matches. Multiple hostnames can be added by calling this method repeatedly. If no hostnames are configured, the ingress matches all hosts.
WithHostname(IResourceBuilder<KubernetesIngressResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesIngressResource>
Adds a hostname using a parameter that will be resolved at deploy time.
WithIngressAnnotation(IResourceBuilder<KubernetesIngressResource>, string, string)extensionats export
IResourceBuilder<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(IResourceBuilder<KubernetesIngressResource>, string, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesIngressResource>
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
WithIngressClass(IResourceBuilder<KubernetesIngressResource>, string)extensionats export
IResourceBuilder<KubernetesIngressResource>
Sets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
WithIngressClass(IResourceBuilder<KubernetesIngressResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesIngressResource>
Sets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
WithRoute(IResourceBuilder<KubernetesIngressResource>, string, EndpointReference, IngressPathType)extensionats export
IResourceBuilder<KubernetesIngressResource>
Adds a path-based routing rule to the ingress. The rule matches all hosts and routes traffic matching the specified path to the given endpoint's backing Kubernetes service.
WithRoute(IResourceBuilder<KubernetesIngressResource>, string, string, EndpointReference, IngressPathType)extensionats export
IResourceBuilder<KubernetesIngressResource>
Adds a host-and-path-based routing rule to the ingress. The rule matches traffic for the specified host and path, routing it to the given endpoint's backing Kubernetes service.
WithTls(IResourceBuilder<KubernetesIngressResource>, string)extensionats export
IResourceBuilder<KubernetesIngressResource>
WithTls(IResourceBuilder<KubernetesIngressResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KubernetesIngressResource>
Configures TLS termination using a parameter for the secret name.
WithTls(IResourceBuilder<KubernetesIngressResource>)extensionats export
IResourceBuilder<KubernetesIngressResource>
Configures TLS termination with an auto-generated secret name derived from the ingress name.
View all methods