# K3sClusterOptions Properties

- Package: [CommunityToolkit.Aspire.Hosting.K3s](/reference/api/csharp/communitytoolkit.aspire.hosting.k3s.md)
- Type: [K3sClusterOptions](/reference/api/csharp/communitytoolkit.aspire.hosting.k3s/k3sclusteroptions.md)
- Kind: `Properties`
- Members: `12`

Advanced options for [K3sBuilderExtensions.AddK3sCluster(IDistributedApplicationBuilder, string, int?, int?)](/reference/api/csharp/communitytoolkit.aspire.hosting.k3s/k3sbuilderextensions/methods.md#addk3scluster-idistributedapplicationbuilder-string-int-int).

<a id="agentcount"></a>

## AgentCount

- Name: `AgentCount`
- Modifiers: `get; set`
- Returns: `int`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the number of agent (worker) nodes. Defaults to `0` (single-node cluster).

```csharp
public int AgentCount { get; set; }
```

<a id="clustercidr"></a>

## ClusterCidr

- Name: `ClusterCidr`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the pod IP address range in CIDR notation ( `--cluster-cidr`). Defaults to k3s built-in value of `10.42.0.0/16` when `null`.

```csharp
public string? ClusterCidr { get; set; }
```

<a id="disabledcomponents"></a>

## DisabledComponents

- Name: `DisabledComponents`
- Modifiers: `get`
- Returns: `IList<string>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs#L47)

Gets the list of built-in k3s components to disable (each passed as `--disable=<component>`).

```csharp
public IList<string> DisabledComponents { get; }
```

## Remarks

Common values: `traefik`, `coredns`, `local-storage`. Note that `servicelb` and `metrics-server` are already disabled by default.

<a id="extraargs"></a>

## ExtraArgs

- Name: `ExtraArgs`
- Modifiers: `get`
- Returns: `IList<string>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs#L52)

Gets the list of raw arguments appended verbatim to the `k3s server` command.

```csharp
public IList<string> ExtraArgs { get; }
```

<a id="helmimage"></a>

## HelmImage

- Name: `HelmImage`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the Helm installer image name. Defaults to `alpine/helm`.

```csharp
public string HelmImage { get; set; }
```

<a id="helmregistry"></a>

## HelmRegistry

- Name: `HelmRegistry`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the container registry for the Helm installer image. Defaults to `docker.io`.

```csharp
public string HelmRegistry { get; set; }
```

<a id="helmtag"></a>

## HelmTag

- Name: `HelmTag`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the Helm installer image tag. Defaults to `3.17.3`.

```csharp
public string HelmTag { get; set; }
```

<a id="imagetag"></a>

## ImageTag

- Name: `ImageTag`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the k3s container image tag, e.g. `v1.32.3-k3s1`. When `null` the version bundled with this package is used.

```csharp
public string? ImageTag { get; set; }
```

<a id="kubectlimage"></a>

## KubectlImage

- Name: `KubectlImage`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the kubectl image name. Defaults to `alpine/kubectl`.

```csharp
public string KubectlImage { get; set; }
```

<a id="kubectlregistry"></a>

## KubectlRegistry

- Name: `KubectlRegistry`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the container registry for the kubectl image. Defaults to `docker.io`.

```csharp
public string KubectlRegistry { get; set; }
```

<a id="kubectltag"></a>

## KubectlTag

- Name: `KubectlTag`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the kubectl image tag. Defaults to `1.36.0`.

```csharp
public string KubectlTag { get; set; }
```

<a id="servicecidr"></a>

## ServiceCidr

- Name: `ServiceCidr`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.K3s/K3sClusterOptions.cs)

Gets or sets the Service cluster IP address range in CIDR notation ( `--service-cidr`). Defaults to k3s built-in value of `10.43.0.0/16` when `null`.

```csharp
public string? ServiceCidr { get; set; }
```
