# 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="warning" %}
If you are unsure what StorageClasses are available in your cluster you can view them with the kubectl get sc command.
{% endhint %}

If your cluster does not specify a default StorageClass, and you don’t configure this parameter, the PersistentVolumeClaim can’t be scheduled and the agent can’t 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
      ```

</div>
````

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cybus.io/1-10-2/documentation/agents/agents-in-kubernetes/configuring-agents-with-the-connectware-agent-helm-chart/configuring-agent-persistence-for-the-connectware-agent-helm-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
