# storage-classes

StorageClasses for CSI drivers already installed in the cluster

This page is generated from [`kix/packages/stable/storage-classes`](https://github.com/kix-run/kix/tree/main/kix/packages/stable/storage-classes).

| | |
| --- | --- |
| Stability | Stable |
| `package` value | `packages.storage-classes` |
| Roles | `storageClasses` |

## Options

### `classes`

StorageClasses to create, keyed by class name. The CSI driver each
class names in `provisioner` must already run in the cluster.
Annotate one class `storageclass.kubernetes.io/is-default-class =
"true"` to make it the cluster default; this is refused when the
flavor reports that the environment already has a default class
(`cluster.roles.storageClasses.binding = "shadowable"`).

- **Type:** `attribute set of (submodule)`
- **Example:**

  ```nix
  {
    local-path-retain = {
      provisioner = "rancher.io/local-path";
      reclaimPolicy = "Retain";
      volumeBindingMode = "WaitForFirstConsumer";
    };
  }
  ```

### `classes.<name>.allowVolumeExpansion`

Whether a claim of this class may grow. Omitted from the manifest when false, because the apiserver leaves the field unset and rendering `false` would differ from an adopted class.

- **Type:** `boolean`
- **Default:** `false`

### `classes.<name>.allowedTopologies`

Nodes volumes of this class may be provisioned for. Omitted from the manifest when empty.

- **Type:** `list of (submodule)`
- **Default:** `[ ]`

### `classes.<name>.allowedTopologies.*.matchLabelExpressions`

Label requirements a node must meet for a volume of this class to be provisioned there.

- **Type:** `list of (submodule)`
- **Default:** `[ ]`

### `classes.<name>.allowedTopologies.*.matchLabelExpressions.*.key`

Node label key, such as `topology.kubernetes.io/zone`.

- **Type:** `string`

### `classes.<name>.allowedTopologies.*.matchLabelExpressions.*.values`

Label values the node must carry one of.

- **Type:** `list of string`
- **Default:** `[ ]`

### `classes.<name>.annotations`

Annotations on the StorageClass. `"storageclass.kubernetes.io/is-default-class" = "true"`
makes it the cluster default, which the apiserver gives every
claim that names no class.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `classes.<name>.labels`

Labels on the StorageClass.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `classes.<name>.mountOptions`

Mount options for volumes of this class. Omitted from the manifest when empty.

- **Type:** `list of string`
- **Default:** `[ ]`

### `classes.<name>.parameters`

Driver-specific parameters passed to the provisioner. Null values are left out. Omitted from the manifest when empty. The apiserver refuses changes to this field, so changing it means deleting and recreating the class.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `classes.<name>.provisioner`

Name of the CSI driver that provisions volumes of this class, such as `rancher.io/local-path`. The driver must already run in the cluster. The apiserver refuses changes to this field, so changing it means deleting and recreating the class.

- **Type:** `string`

### `classes.<name>.reclaimPolicy`

What happens to a volume when its claim is deleted. The apiserver refuses changes to this field, so changing it means deleting and recreating the class.

- **Type:** `one of "Delete", "Retain"`
- **Default:** `"Delete"`

### `classes.<name>.volumeBindingMode`

When a volume is provisioned: as soon as the claim exists, or once a pod using it is scheduled. Node-local drivers need `WaitForFirstConsumer`. The apiserver refuses changes to this field, so changing it means deleting and recreating the class.

- **Type:** `one of "Immediate", "WaitForFirstConsumer"`
- **Default:** `"Immediate"`