KubernetesIngressResource Constructors
ClassConstructors1 member
Represents a Kubernetes Ingress as a first-class resource in the Aspire application model. An Ingress defines HTTP routing rules that direct external traffic to services in the cluster.
Constructor(string, KubernetesEnvironmentResource) Section titled Constructor(string, KubernetesEnvironmentResource) Represents a Kubernetes Ingress as a first-class resource in the Aspire application model. An Ingress defines HTTP routing rules that direct external traffic to services in the cluster.
public class KubernetesIngressResource{ public KubernetesIngressResource( string name, KubernetesEnvironmentResource environment) { // ... }}Parameters
namestringThe name of the ingress resource.environmentKubernetesRemarks
Create an ingress using Kubernetes and configure path rules using Kubernetes.
At publish time, the ingress generates a Kubernetes networking. resource in the Helm chart output with rules derived from the configured paths.
Examples
var k8s = builder.AddKubernetesEnvironment("k8s");var ingress = k8s.AddIngress("public") .WithIngressClass("nginx");
var api = builder.AddDotnetProject("api", "../Api/Api.csproj");ingress.WithPath("/api", api.GetEndpoint("http"));