Skip to content
DocsTry Aspire
DocsTry

K3sClusterResource

Classsealednet10.0
📦 CommunityToolkit.Aspire.Hosting.K3s v13.4.1-beta.706
Represents a k3s Kubernetes cluster running as a privileged container resource. Injects the cluster's kubeconfig into a dependent resource.
  • Host processes receive KUBECONFIG=<host-path>/local/kubeconfig.yaml.
  • Containers receive KUBECONFIG=/tmp/k3s-kubeconfig.yaml and a file-level bind-mount of the container-network kubeconfig variant. Both are applied by the BeforeStartEvent subscriber registered in AddK3sCluster.
namespace Aspire.Hosting.ApplicationModel;
public sealed class K3sClusterResource
: Aspire.Hosting.ApplicationModel.ContainerResource,
Aspire.Hosting.ApplicationModel.IExpressionValue,
Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
Aspire.Hosting.ApplicationModel.IResource,
Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
Aspire.Hosting.ApplicationModel.IValueProvider,
Aspire.Hosting.ApplicationModel.IValueWithReferences
{
// ...
}
ContainerResourceIExpressionValueIManifestExpressionProviderIResourceIResourceWithConnectionStringIValueProviderIValueWithReferences