Aspire.Hosting.Kubernetes
Official
📦 Aspire.Hosting.Kubernetesv17.0.0Import path
apphost/modules/aspire61Functions
19Types
19 types, 61 functions and 33 members
Handles
handle
CertManagerIssuerResource3 membershandle
CertManagerResource1 membershandle
HelmChartOptions5 membershandle
KubernetesAspireDashboardResource5 membershandle
KubernetesEnvironmentResource19 membershandle
KubernetesGatewayResource12 membershandle
KubernetesHelmChartResource5 membershandle
KubernetesIngressResource12 membershandle
KubernetesManifestResource5 membershandle
KubernetesNodePoolResourcehandle
KubernetesPersistentVolumeResource10 membershandle
KubernetesResource2 membershandle
ObjectMetaV12 membershandle
PersistentVolumeClaim2 membershandle
PersistentVolumeClaimSpecV15 membershandle
VolumeResourceRequirementsV11 membersEnums
Functions
CertManagerIssuerResource
method
WithAcmeServerbuilderConfigures the ACME directory URL and contact email using either two strings or two parameters.
WithAcmeServer(serverUrl any, email any) CertManagerIssuerResourcemethod
WithExternalAccountBindingbuilderConfigures External Account Binding (EAB) with a key identifier and secret HMAC key resolved at deploy time.
WithExternalAccountBinding(keyId ParameterResource, hmacKey ParameterResource) CertManagerIssuerResourcemethod
WithHttp01SolverbuilderAdds an HTTP-01 ACME challenge solver to the issuer. cert-manager will satisfy the challenge by provisioning a temporary HTTP route at
/.well-known/acme-challenge/{token} on the same hostname being validated. This requires the hostname to be publicly reachable on port 80.WithHttp01Solver() CertManagerIssuerResourceCertManagerResource
DistributedApplicationBuilder
IComputeResource
method
PublishAsKubernetesServicebuilderPublishes the specified resource as a Kubernetes service.
PublishAsKubernetesService(configure func(obj KubernetesResource)) IComputeResourcemethod
WithKubernetesPersistentVolumebuilderBinds a workload to a Kubernetes persistent volume by matching volume name
WithKubernetesPersistentVolume(volume KubernetesPersistentVolumeResource) IComputeResourcemethod
WithKubernetesPersistentVolumeMountbuilderBinds a workload to a Kubernetes persistent volume and mounts it at a path
WithKubernetesPersistentVolumeMount(volume KubernetesPersistentVolumeResource, mountPath string, options ...*WithKubernetesPersistentVolumeMountOptions) IComputeResourceKubernetesAspireDashboardResource
method
WithForwardedHeadersbuilderConfigures whether forwarded headers processing is enabled for the Aspire dashboard container.
WithForwardedHeaders(options ...*WithForwardedHeadersOptions) KubernetesAspireDashboardResourcemethod
WithOtlpServicePortbuilderSets the Kubernetes Service ports for the Aspire Dashboard OTLP endpoints.
WithOtlpServicePort(options ...*WithOtlpServicePortOptions) KubernetesAspireDashboardResourcemethod
WithServicePortbuilderSets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.
WithServicePort(options ...*WithServicePortOptions) KubernetesAspireDashboardResourceKubernetesEnvironmentResource
method
AddCertManagerbuilderInstalls cert-manager into a Kubernetes environment
AddCertManager(name string, options ...*AddCertManagerOptions) CertManagerResourcemethod
AddGatewaybuilderAdds a Kubernetes Gateway API Gateway resource to the application model as a child of the specified Kubernetes environment. The gateway generates a
gateway.networking.k8s.io/v1 Gateway resource and one or more HTTPRoute resources in the Helm chart output at publish time.AddGateway(name string) KubernetesGatewayResourcemethod
AddHelmChartbuilderAdds an external Helm chart to be installed in the Kubernetes environment. The chart is installed via
helm upgrade --install as a pipeline step after the main application Helm chart is deployed.AddHelmChart(name string, chartReference string, chartVersion string) KubernetesHelmChartResourcemethod
AddIngressbuilderAdds 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.AddIngress(name string) KubernetesIngressResourcemethod
AddNodePoolbuilderAdds a named node pool to the Kubernetes environment.
AddNodePool(name string) KubernetesNodePoolResourcemethod
AddPersistentVolumebuilderAdds a Kubernetes PersistentVolumeClaim resource
AddPersistentVolume(name string) KubernetesPersistentVolumeResourcemethod
ConfigureDashboardbuilderConfigures the dashboard properties for this Kubernetes environment.
ConfigureDashboard(configure func(obj KubernetesAspireDashboardResource)) KubernetesEnvironmentResourcemethod
WithDashboardbuilderEnables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
WithDashboard(options ...*WithDashboardOptions) KubernetesEnvironmentResourcemethod
WithHelmbuilderConfigures the Kubernetes environment to deploy using Helm charts.
WithHelm(options ...*WithHelmOptions) KubernetesEnvironmentResourcemethod
WithPropertiesbuilderAllows setting the properties of a Kubernetes environment resource.
WithProperties(configure func(obj KubernetesEnvironmentResource)) KubernetesEnvironmentResourceKubernetesGatewayResource
method
WithGatewayAnnotationbuilderAdds a Kubernetes metadata annotation to the generated Gateway resource.
WithGatewayAnnotation(key string, value string) KubernetesGatewayResourcemethod
WithGatewayAnnotationParambuilderAdds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
WithGatewayAnnotationParam(key string, value ParameterResource) KubernetesGatewayResourcemethod
WithGatewayClassbuilderSets the GatewayClass name that selects which controller implementation handles this gateway.
WithGatewayClass(className string) KubernetesGatewayResourcemethod
WithGatewayClassParambuilderSets the GatewayClass name using a parameter that will be resolved at deploy time.
WithGatewayClassParam(className ParameterResource) KubernetesGatewayResourcemethod
WithGatewayHostnameParambuilderAdds a hostname using a parameter that will be resolved at deploy time.
WithGatewayHostnameParam(hostname ParameterResource) KubernetesGatewayResourcemethod
WithGatewayHostRoutebuilderAdds a host-and-path-based routing rule to the gateway. The rule matches traffic for the specified host and path, routing it to the given endpoint's backing Kubernetes service. This generates an
HTTPRoute resource with a hostnames filter.WithGatewayHostRoute(host string, path string, endpoint EndpointReference, options ...*WithGatewayHostRouteOptions) KubernetesGatewayResourcemethod
WithGatewayPathRoutebuilderAdds a path-based routing rule to the gateway. The rule matches each hostname configured with
WithHostname , or all hosts when no hostname is configured, and routes matching traffic to the endpoint's backing Kubernetes service. This generates an HTTPRoute resource attached to the Gateway.WithGatewayPathRoute(path string, endpoint EndpointReference, options ...*WithGatewayPathRouteOptions) KubernetesGatewayResourcemethod
WithGatewayTlsAutobuilderConfigures TLS termination with an auto-generated secret name derived from the gateway name.
WithGatewayTlsAuto() KubernetesGatewayResourcemethod
WithGatewayTlsIssuerbuilderAdds an HTTPS listener to the gateway and wires it to the supplied cert-manager
ClusterIssuer . This adds the cert-manager.io/cluster-issuer annotation to the generated Gateway resource, causing cert-manager to provision and renew a certificate for each gateway listener hostname.WithGatewayTlsIssuer(issuer CertManagerIssuerResource) KubernetesGatewayResourcemethod
WithGatewayTlsParambuilderConfigures TLS termination using a parameter for the secret name.
WithGatewayTlsParam(secretName ParameterResource) KubernetesGatewayResourcemethod
WithHostnamebuilderAdds 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) KubernetesGatewayResourcemethod
WithTlsbuilderConfigures TLS on a Kubernetes Gateway listener
WithTls(secretName string) KubernetesGatewayResourceKubernetesHelmChartResource
method
WithHelmChartDestroybuilderOpts the Helm chart in to destroy-time uninstall. When set,
aspire destroy will run helm uninstall for this release as part of the destroy pipeline.WithHelmChartDestroy() KubernetesHelmChartResourcemethod
WithHelmChartForceConflictsbuilderOpts the Helm chart in to
helm upgrade --install --force-conflicts . When set, Helm's server-side apply forcibly takes over any fields owned by another field manager instead of failing with a conflict.WithHelmChartForceConflicts() KubernetesHelmChartResourcemethod
WithHelmChartNamespacebuilderSets the Kubernetes namespace for the Helm chart installation. If not set, the namespace defaults to the chart resource name.
WithHelmChartNamespace(namespace string) KubernetesHelmChartResourcemethod
WithHelmChartReleaseNamebuilderSets the Helm release name for the chart installation. If not set, the release name defaults to the resource name.
WithHelmChartReleaseName(releaseName string) KubernetesHelmChartResourcemethod
WithHelmValuebuilderSets a Helm value for the chart installation. Values are passed to
helm upgrade --install via --set flags.WithHelmValue(key string, value string) KubernetesHelmChartResourceKubernetesIngressResource
method
WithDefaultBackendbuilderSets the default backend for the ingress. The default backend handles requests that do not match any of the defined routing rules.
WithDefaultBackend(endpoint EndpointReference) KubernetesIngressResourcemethod
WithHostnamebuilderAdds a hostname that this ingress matches. Multiple hostnames can be added by calling this method repeatedly. Path rules without an explicit host apply to each configured hostname. If no hostnames are configured, those rules match all hosts.
WithHostname(hostname string) KubernetesIngressResourcemethod
WithIngressAnnotationbuilderAdds 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(key string, value string) KubernetesIngressResourcemethod
WithIngressAnnotationParambuilderAdds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
WithIngressAnnotationParam(key string, value ParameterResource) KubernetesIngressResourcemethod
WithIngressClassbuilderSets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
WithIngressClass(className string) KubernetesIngressResourcemethod
WithIngressClassParambuilderSets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
WithIngressClassParam(className ParameterResource) KubernetesIngressResourcemethod
WithIngressHostAndPathbuilderAdds a host-scoped path rule to the ingress. The rule matches traffic for the specified host and path, forwarding it to the given endpoint's backing Kubernetes service.
WithIngressHostAndPath(host string, path string, endpoint EndpointReference, options ...*WithIngressHostAndPathOptions) KubernetesIngressResourcemethod
WithIngressHostnameParambuilderAdds a hostname using a parameter that will be resolved at deploy time.
WithIngressHostnameParam(hostname ParameterResource) KubernetesIngressResourcemethod
WithIngressPathbuilderAdds a path-based rule to the ingress. The rule matches each hostname configured with
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) KubernetesIngressResourcemethod
WithIngressTlsAutobuilderConfigures TLS termination with an auto-generated secret name derived from the ingress name.
WithIngressTlsAuto() KubernetesIngressResourcemethod
WithIngressTlsParambuilderConfigures TLS termination using a parameter for the secret name.
WithIngressTlsParam(secretName ParameterResource) KubernetesIngressResourcemethod
WithTlsbuilderConfigures TLS for a Kubernetes Ingress using a K8S secret
WithTls(secretName string) KubernetesIngressResourceKubernetesPersistentVolumeResource
method
WithAccessModebuilderAdds an access mode to a persistent volume
WithAccessMode(accessMode PersistentVolumeAccessMode) KubernetesPersistentVolumeResourcemethod
WithCapacitybuilderSets the requested storage capacity for a persistent volume
WithCapacity(capacity string) KubernetesPersistentVolumeResourcemethod
WithCapacityParambuilderSets a parameterized storage capacity for a persistent volume
WithCapacityParam(capacity ParameterResource) KubernetesPersistentVolumeResourcemethod
WithConfigurationbuilderConfigures the generated persistent volume claim
WithConfiguration(configure func(obj PersistentVolumeClaim)) KubernetesPersistentVolumeResourcemethod
WithoutStorageClassbuilderOmits
spec.storageClassName from the generated PVC so Kubernetes can assign the cluster's default StorageClass. To request a classless volume, call WithStorageClass with an empty string.WithoutStorageClass() KubernetesPersistentVolumeResourcemethod
WithPersistentVolumeNamebuilderSets the name of the existing PersistentVolume to bind to in the generated PVC's
spec.volumeName .WithPersistentVolumeName(persistentVolumeName string) KubernetesPersistentVolumeResourcemethod
WithStorageClassbuilderSets the Kubernetes storage class name on the PVC's
spec.storageClassName . When unset, the cluster's default storage class is used. An empty string explicitly disables storage class assignment.WithStorageClass(storageClassName string) KubernetesPersistentVolumeResourcemethod
WithStorageClassParambuilderSets a parameterized storage class for a persistent volume
WithStorageClassParam(storageClassName ParameterResource) KubernetesPersistentVolumeResourcemethod
WithVolumeAnnotationbuilderAdds a Kubernetes metadata annotation to a persistent volume
WithVolumeAnnotation(key string, value string) KubernetesPersistentVolumeResourcemethod
WithVolumeAnnotationParambuilderAdds a parameterized Kubernetes metadata annotation to a persistent volume
WithVolumeAnnotationParam(key string, value ParameterResource) KubernetesPersistentVolumeResource