KubernetesEnvironmentResource
Classsealednet10.0
Represents a Kubernetes environment resource that can host application resources.
namespace Aspire.Hosting.Kubernetes;
public sealed class KubernetesEnvironmentResource : Aspire.Hosting.ApplicationModel.Resource, Aspire.Hosting.ApplicationModel.IComputeEnvironmentResource, Aspire.Hosting.ApplicationModel.IComputeEnvironmentWithVolumeMounts, Aspire.Hosting.ApplicationModel.IResource{ // ...}ResourceIComputeEnvironmentResourceIComputeEnvironmentWithVolumeMountsIResource
11 members
Remarks
Section titled Remarks This resource models the Kubernetes publishing environment used by Aspire when generating Helm charts and other Kubernetes manifests for application resources that will run on a Kubernetes cluster.
Constructors1
Section titled Constructors Initializes a new instance of the
KubernetesEnvironmentResource class. Properties9
Section titled PropertiesDashboardEnabled get; setbool Determines whether to include an Aspire dashboard for telemetry visualization in this environment.
DefaultImagePullPolicy get; setstring Gets or sets the default policy that determines how Docker images are pulled during deployment. Possible values are: "Always" - Always attempt to pull the image from the registry. "IfNotPresent" - Pull the image only if it is not already present locally. "Never" - Never pull the image, use only the local image. The default value is "IfNotPresent".
DefaultServiceType get; setstring Gets or sets the default Kubernetes service type to be used when generating artifacts.
DefaultStorageClassName get; setstring? Specifies the default name of the storage class to be used for persistent volume claims in Kubernetes. This property allows customization of the storage class for specifying storage requirements such as performance, retention policies, and provisioning parameters. If set to null, the default storage class for the cluster will be used.
DefaultStorageReadWritePolicy get; setstring Gets or sets the default access policy for reading and writing to the storage.
DefaultStorageType get; setstring Specifies the default type of storage used for Kubernetes deployments.
KubeConfigPath get; setstring? Gets or sets the path to an explicit kubeconfig file for Helm and kubectl commands. When set, all Helm and kubectl commands will use
--kubeconfig to target this file instead of the default ~/.kube/config . OwningComputeEnvironment get; setIComputeEnvironmentResource? Gets or sets the parent compute environment resource that owns this Kubernetes environment. When set, resources with
WithComputeEnvironment targeting the parent will also be processed by this Kubernetes environment. Methods1
Section titled MethodsGetHostAddressExpression(EndpointReference) experimentalReferenceExpression Gets a
ApplicationModel.ReferenceExpression representing the host address or host name for the specified ApplicationModel.EndpointReference .