# CommunityToolkit.Aspire.Hosting.K3s

- Module: `CommunityToolkit.Aspire.Hosting.K3s`
- Version: `13.6.1`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)
- Functions: `16`
- Types: `4`

## Handles

- [HelmReleaseResource](/reference/api/go/communitytoolkit.aspire.hosting.k3s/helmreleaseresource.md) -- `handle` - 5 members -- Represents a Helm chart release installed into a k3s cluster.
- [K3sClusterResource](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k3sclusterresource.md) -- `handle` - 16 members -- Represents a k3s Kubernetes cluster running as a privileged container resource. Injects the cluster's kubeconfig into a dependent resource. - -
- [K3sServiceEndpointResource](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k3sserviceendpointresource.md) -- `handle` - 7 members -- Represents a Kubernetes Service exposed from a k3s cluster as an Aspire endpoint resource.
- [K8sManifestResource](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k8smanifestresource.md) -- `handle` - 2 members -- Represents a Kubernetes manifest (or Kustomize overlay) applied to the parent k3s cluster.

## Functions

- [AddK3sCluster](/reference/api/go/communitytoolkit.aspire.hosting.k3s/addk3scluster.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a k3s Kubernetes cluster to the distributed application.
- [WithHelmValue](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withhelmvalue.md) -- `method` - on `HelmReleaseResource` -- Adds a Helm `--set key=value` override to the release.
- [WithHelmValuesFile](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withhelmvaluesfile.md) -- `method` - on `HelmReleaseResource` -- Supplies a YAML values file to the Helm release (`--values`).
- [AddHelmRelease](/reference/api/go/communitytoolkit.aspire.hosting.k3s/addhelmrelease.md) -- `method` - on `K3sClusterResource` -- Installs a Helm chart into the k3s cluster.
- [AddK8sManifest](/reference/api/go/communitytoolkit.aspire.hosting.k3s/addk8smanifest.md) -- `method` - on `K3sClusterResource` -- Applies Kubernetes YAML manifests or a Kustomize overlay to the cluster.
- [AddServiceEndpoint](/reference/api/go/communitytoolkit.aspire.hosting.k3s/addserviceendpoint.md) -- `method` - on `K3sClusterResource` -- Exposes a Kubernetes Service from the cluster as an Aspire endpoint resource.
- [WithAgentCount](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withagentcount.md) -- `method` - on `K3sClusterResource` -- Sets the number of k3s agent (worker) nodes to add to the cluster.
- [WithDataVolume](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withdatavolume.md) -- `method` - on `K3sClusterResource` -- Mounts a named Docker volume at the k3s data directory so cluster state persists across AppHost restarts.
- [WithDisabledComponent](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withdisabledcomponent.md) -- `method` - on `K3sClusterResource` -- Disables a built-in k3s component (`--disable=<component>`).
- [WithExtraArg](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withextraarg.md) -- `method` - on `K3sClusterResource` -- Appends a raw argument to the `k3s server` command line.
- [WithHelmImage](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withhelmimage.md) -- `method` - on `K3sClusterResource` -- Overrides the container image used to run `helm upgrade --install` for all `HelmReleaseResource` children of this cluster.
- [WithK3sVersion](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withk3sversion.md) -- `method` - on `K3sClusterResource` -- Sets the k3s image version used by the cluster server and all its agent nodes.
- [WithKubectlImage](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withkubectlimage.md) -- `method` - on `K3sClusterResource` -- Overrides the container image used to run `kubectl apply` for all `K8sManifestResource` children of this cluster.
- [WithLifetime](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withlifetime.md) -- `method` - on `K3sClusterResource` -- Sets the container lifetime for the k3s cluster and all its agent nodes.
- [WithPodSubnet](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withpodsubnet.md) -- `method` - on `K3sClusterResource` -- Sets the CIDR range for pod IP addresses (`--cluster-cidr`).
- [WithServiceSubnet](/reference/api/go/communitytoolkit.aspire.hosting.k3s/withservicesubnet.md) -- `method` - on `K3sClusterResource` -- Sets the CIDR range for Service cluster IPs (`--service-cidr`).
