KubernetesIngressResource
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.
type KubernetesIngressResource interface { Resource ResourceWithParent}Methods
WithDefaultBackend(endpoint EndpointReference) KubernetesIngressResourceParameters
endpointEndpointReference The endpoint reference identifying the default backend service and port.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithHostname(hostname string) KubernetesIngressResourceParameters
hostnamestringThe hostname to match (e.g., "api.example.com" ).Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
metadata.annotations field of the K8S Ingress, commonly used to configure ingress controller-specific behavior.WithIngressAnnotation( key string, value string,) KubernetesIngressResourceParameters
keystringThe annotation key (e.g., "nginx.ingress.kubernetes.io/rewrite-target" ).valuestringThe annotation value.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressAnnotationParam( key string, value ParameterResource,) KubernetesIngressResourceParameters
keystringThe annotation key.valueParameterResource A parameter resource builder for the annotation value.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressClass(className string) KubernetesIngressResourceParameters
className stringThe ingress class name (e.g., "nginx", "traefik", "azure-alb-external" ).Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressClassParam(className ParameterResource) KubernetesIngressResourceParameters
className ParameterResource A parameter resource builder for the ingress class name.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressHostAndPath( host string, path string, endpoint EndpointReference, options ...*WithIngressHostAndPathOptions,) KubernetesIngressResourceParameters
hoststringThe hostname to match (e.g., "api.example.com" ).pathstringThe URL path to match (e.g., "/" or "/api"). Must start with /.endpointEndpointReference The endpoint reference identifying the target service and port.options...*WithIngressHostAndPathOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithIngressHostAndPathOptions argument.
PathType *IngressPathType The path matching strategy. Defaults to Prefix.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressHostnameParam(hostname ParameterResource) KubernetesIngressResourceParameters
hostnameParameterResource A parameter resource builder for the hostname value.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithHostname , or all hosts when no hostname is configured, and forwards matching traffic to the endpoint's backing Kubernetes service.WithIngressPath( path string, endpoint EndpointReference, options ...*WithIngressPathOptions,) KubernetesIngressResourceParameters
pathstringThe URL path to match (e.g., "/" or "/api"). Must start with /.endpointEndpointReference The endpoint reference identifying the target service and port.options...*WithIngressPathOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithIngressPathOptions argument.
PathType *IngressPathType The path matching strategy. Defaults to Prefix.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressTlsAuto() KubernetesIngressResourceReturns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithIngressTlsParam(secretName ParameterResource) KubernetesIngressResourceParameters
secretName ParameterResource A parameter resource builder for the secret name.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().
WithTls(secretName string) KubernetesIngressResourceParameters
secretName stringThe name of the Kubernetes kubernetes.io/tls Secret.Returns
KubernetesIngressResource The resource builder.
Returns a handle; failures surface later via Err().