# Configuring Agent Persistence for the connectware-agent Helm Chart

Connectware agents use a PersistentVolumeClaim to persist data in between restarts.

Persistence configuration parameters for existing agents can’t be changed. To do so uninstall and reinstall the agent

## Configuring Desired StorageClass

By default, agents will use the Kubernetes clusters default storage class.

To specify another StorageClass to use, set the Helm value persistence.storageClassName inside the agents entry in protocolMapperAgents context of your `values.yaml` file to the name of your StorageClass.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    persistence:
      storageClassName: nfs-client # use the actual StorageClass name
```

{% endcode %}

{% hint style="info" %}
To see which StorageClasses are available in your cluster, run the `kubectl get sc` command.
{% endhint %}

If your cluster does not specify a default StorageClass, and you don’t configure this parameter, the PersistentVolumeClaim cannot be scheduled and the agent cannot start

## Configuring Desired Volume Size

To specify a size for the PersistentVolume used by the agent, set the Helm value persistence.size inside the agents entry in protocolMapperAgents context of your `values.yaml` file to a valid Kubernetes Quantity.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    persistence:
      size: 500Mi
```

{% endcode %}

## Configuring Desired AccessMode

To specify an AccessMode for the PersistentVolume used by the agent, set the Helm value persistence.accessMode inside the agents entry in protocolMapperAgents context of your `values.yaml` file to a valid Kubernetes volume AccessMode.

**Example**

{% code lineNumbers="true" %}

```yaml
licenseKey: <your-connectware-license-key>
protocolMapperAgents:
  - name: bender-robots
    connectwareHost: connectware.cybus # adjust to actual hostname of Connectware
    persistence:
      accessMode: ReadWriteMany
```

{% endcode %}
