# CommunityToolkit.Aspire.Hosting.K3s

- Module: `CommunityToolkit.Aspire.Hosting.K3s`
- Version: `13.5.0`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/4ff8268fbd97ddd23cb73dc8eff9cc92718156d1)
- Functions: `16`
- Types: `4`

## Types

- [HelmReleaseResource](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/helmreleaseresource.md) -- `handle` - 5 members -- Represents a Helm chart release installed into a k3s cluster.
- [K3sClusterResource](/reference/api/typescript/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/typescript/communitytoolkit.aspire.hosting.k3s/k3sserviceendpointresource.md) -- `handle` - 8 members -- Represents a Kubernetes Service exposed from a k3s cluster as an Aspire endpoint resource.
- [K8sManifestResource](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/k8smanifestresource.md) -- `handle` - 2 members -- Represents a Kubernetes manifest (or Kustomize overlay) applied to the parent k3s cluster.

## Functions

- [addHelmRelease](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/addhelmrelease.md) -- `method` -- Installs a Helm chart into the k3s cluster.
- [addK3sCluster](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/addk3scluster.md) -- `method` -- Adds a k3s Kubernetes cluster to the distributed application.
- [addK8sManifest](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/addk8smanifest.md) -- `method` -- Applies Kubernetes YAML manifests or a Kustomize overlay to the cluster.
- [addServiceEndpoint](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/addserviceendpoint.md) -- `method` -- Exposes a Kubernetes Service from the cluster as an Aspire endpoint resource.
- [withAgentCount](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withagentcount.md) -- `method` -- Sets the number of k3s agent (worker) nodes to add to the cluster.
- [withDataVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withdatavolume.md) -- `method` -- Mounts a named Docker volume at the k3s data directory so cluster state persists across AppHost restarts.
- [withDisabledComponent](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withdisabledcomponent.md) -- `method` -- Disables a built-in k3s component (`--disable=<component>`).
- [withExtraArg](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withextraarg.md) -- `method` -- Appends a raw argument to the `k3s server` command line.
- [withHelmImage](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withhelmimage.md) -- `method` -- Overrides the container image used to run `helm upgrade --install` for all `HelmReleaseResource` children of this cluster.
- [withHelmValue](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withhelmvalue.md) -- `method` -- Adds a Helm `--set key=value` override to the release.
- [withHelmValuesFile](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withhelmvaluesfile.md) -- `method` -- Supplies a YAML values file to the Helm release (`--values`).
- [withK3sVersion](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withk3sversion.md) -- `method` -- Sets the k3s image version used by the cluster server and all its agent nodes.
- [withKubectlImage](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withkubectlimage.md) -- `method` -- Overrides the container image used to run `kubectl apply` for all `K8sManifestResource` children of this cluster.
- [withLifetime](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withlifetime.md) -- `method` -- Sets the container lifetime for the k3s cluster and all its agent nodes.
- [withPodSubnet](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withpodsubnet.md) -- `method` -- Sets the CIDR range for pod IP addresses (`--cluster-cidr`).
- [withServiceSubnet](/reference/api/typescript/communitytoolkit.aspire.hosting.k3s/withservicesubnet.md) -- `method` -- Sets the CIDR range for Service cluster IPs (`--service-cidr`).
