KubernetesAspireDashboardResourceBuilderExtensions Methods
Class Methods 3 members
Provides extension methods for creating Aspire Dashboard resources in the application model.
WithForwardedHeaders(IResourceBuilder<KubernetesAspireDashboardResource>, bool) Section titled WithForwardedHeaders(IResourceBuilder<KubernetesAspireDashboardResource>, bool) extension IResourceBuilder<KubernetesAspireDashboardResource> Configures whether forwarded headers processing is enabled for the Aspire dashboard container.
public static class KubernetesAspireDashboardResourceBuilderExtensions{ public static IResourceBuilder<KubernetesAspireDashboardResource> WithForwardedHeaders( this IResourceBuilder<KubernetesAspireDashboardResource> builder, bool enabled = true) { // ... }}Parameters
builder IResourceBuilder<KubernetesAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance. enabled bool optional True to enable forwarded headers, false to disable. Returns
IResourceBuilder<KubernetesAspireDashboardResource> The same ApplicationModel.IResourceBuilder`1 to allow chaining. Remarks
This sets the
ASPIRE_DASHBOARD_FORWARDEDHEADERS_ENABLED environment variable inside the dashboard container. When enabled, the dashboard will process X-Forwarded-Host and X-Forwarded-Proto headers which is required when the dashboard is accessed through a reverse proxy or ingress controller. WithOtlpServicePort(IResourceBuilder<KubernetesAspireDashboardResource>, int?, int?) Section titled WithOtlpServicePort(IResourceBuilder<KubernetesAspireDashboardResource>, int?, int?) extension IResourceBuilder<KubernetesAspireDashboardResource> Sets the Kubernetes Service ports for the Aspire Dashboard OTLP endpoints.
public static class KubernetesAspireDashboardResourceBuilderExtensions{ public static IResourceBuilder<KubernetesAspireDashboardResource> WithOtlpServicePort( this IResourceBuilder<KubernetesAspireDashboardResource> builder, int? grpcPort = null, int? httpPort = null) { // ... }}Parameters
builder IResourceBuilder<KubernetesAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance to configure. grpcPort int? optional The Service port for the OTLP gRPC endpoint. If null, the Service port defaults to the container port (18889). httpPort int? optional The Service port for the OTLP HTTP endpoint. If null, the Service port defaults to the container port (18890). Returns
IResourceBuilder<KubernetesAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance for chaining. Remarks
This sets the
port field on the generated Kubernetes Service for the OTLP endpoints while keeping the targetPort as the original container port. Application resources in the cluster send telemetry to these Service ports. Use standard OTLP ports (4317 for gRPC, 4318 for HTTP) if your services are configured with those defaults. WithServicePort(IResourceBuilder<KubernetesAspireDashboardResource>, int?) Section titled WithServicePort(IResourceBuilder<KubernetesAspireDashboardResource>, int?) extension IResourceBuilder<KubernetesAspireDashboardResource> Sets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.
public static class KubernetesAspireDashboardResourceBuilderExtensions{ public static IResourceBuilder<KubernetesAspireDashboardResource> WithServicePort( this IResourceBuilder<KubernetesAspireDashboardResource> builder, int? port = null) { // ... }}Parameters
builder IResourceBuilder<KubernetesAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance to configure. port int? optional The Service port number. Cluster-internal clients will connect to this port, which routes to the dashboard's container port (18888). If null, the Service port defaults to the container port. Returns
IResourceBuilder<KubernetesAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance for chaining. Remarks
This sets the
port field on the generated Kubernetes Service while keeping the targetPort as the original container port. This is useful when placing the dashboard behind an ingress controller that expects a specific Service port (for example, port 80). To access the dashboard from outside the cluster, use kubectl port-forward or configure the environment's KubernetesEnvironmentResource.DefaultServiceType to NodePort or LoadBalancer.