Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithHostname

Method
📦 Aspire.Hosting.Kubernetes v13.6.5-preview.1.26559.7
func (KubernetesGatewayResource) WithHostname(hostname string) KubernetesGatewayResource

Signature

methodWithHostnamebuilder
Adds a hostname that this gateway's routes match. Multiple hostnames can be added by calling this method repeatedly. Routes without an explicit host apply to each configured hostname. Hostnames are used as hostnames in generated HTTPRoute resources and as HTTPS listener hostnames when TLS is configured.
WithHostname(hostname string) KubernetesGatewayResource
hostnamestringThe hostname to match (e.g., "api.example.com").
KubernetesGatewayResource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: