# Agent storage availability

File storages and their mount points that are available for Agents depend on the operating system Agent is running on. Here's listed some common storage locations available to Frends Agents, to be used in Processes for file storage.

## PaaS Agent storage

For Frends Platform-as-a-Service (PaaS) Agents, specific drives are pre-mounted and available for use.

**Shared Agent Group Storage:** Each PaaS (Frends Cloud) Agent Group has an Azure file share that can be used to store files and share them among all Agents in the same Agent Group. It is mounted as the `F` drive on Windows-based Agents, or `/frends-shared-data/` on Linux Agents.&#x20;

**Local Agent Storage:** Windows and stand-alone Linux PaaS Agents have a 32 GB local drive for storing files. This is mounted as the `G:` drive or `/frends-local-data/`. This drive is not available for Kubernetes Agents.&#x20;

**Internal System Drive:** Frends PaaS Agents also have a small internal drive (e.g., `C:` drive on Windows) used by the operating system and Frends itself. This drive should not be used for storing other data.

## **On-Premises and Self-Hosted Storage**

For on-premises or self-hosted deployments, Frends can be configured to access various file systems.

**Local File System:** The Agent requires access to the local file system to store its own operational data, such as Process executables and SQLite databases. You can also use local file paths for file operations within your Processes.

**Mounted Network Shares (SMB/CIFS):** Frends Agents can use network file shares. This is useful for accessing shared data across different systems. Storage locations that have been mounted on the server hosting the Agent are accessible.

**Azure Files:** You can mount an Azure File Share to a Frends Agent, for example, running in Azure Kubernetes Service (AKS).

**NFS (Network File System):** It is possible to mount an NFS share to a Frends Agent, for instance, in a Kubernetes environment. However, there have been reported issues with SQLite database locking when the `persisted-system` directory is mounted on an NFS drive due to latency.

## **Kubernetes Volume Mounts**

When deploying Frends Agents on Kubernetes, you can use volumes to persist data outside the Agent pod.

### **persisted-system**

This volume mount can store the Frends Agent's internal database and Processes, ensuring they are not lost if the pod restarts. This is typically recommended only for development and testing environments, and for production use the Shared State Store is recommended instead.

### **persisted-data**

This volume is used to mount an external file system that the Agent can use to store and retrieve process data.

### **HostPath Volumes**

This simple option mounts a directory from the host node's filesystem directly into the Agent pod. It can be used for both `persisted-system` and `persisted-data` mounts.

To mount a hostPath volume as persisted-data or persisted-system, first specify the volumeMount in FRENDS-Agent-Deploy.yaml:

```
volumeMounts:
- name: persisted-data  
  mountPath: /persisted-data
```

Next, add the volume in FRENDS-Agent-Deploy.yaml:

```
volumes:
- name: persisted-data  
  hostPath:    
    path: /host_mnt/c/FRENDS/persisted-data/AgentGroupName
```

Replace the persisted-data in these examples with the persisted-system if necessary. The example path maps to C:\FRENDS\Persisted-data folder on Windows host system.

[Check here to learn more about Kubernetes HostPath volumes](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath).

### **AzureFile Volumes**

You can mount a Microsoft Azure File Share into a pod running in Azure Kubernetes Service (AKS). This is supported for the persisted-data volume only.

Create a Frends Agent Storage Secret by running the kubectl command:

```
kubectl -n [NameSpace] create secret generic azure-storage-secret --from-literal=azurestorageaccountname="[AzureStorageAccountName]" --from-literal=azurestorageaccountkey="[AzureStorageAccountKey]"
```

Replace the following parameters in square brackets:

* **NameSpace**: Kubernetes NameSpace that your Frends Agent is deployed to.
* **AzureStorageAccountName:** The name of your Azure Storage Account.
* **AzureStorageAccountKey:** The primary or secondary Access Key for your storage account. You can get this from the Azure Portal.

Edit the FRENDS-Agent-Deploy.yaml file and add a persisted-data volumeMount to volumeMounts:

```
volumeMounts:
  - name: persisted-data
    mountPath: /persisted-data
```

Next add the persisted-data volume under volumes:

```
volumes:
- name: persisted-data
  azureFile:    
    secretName: azure-storage-secret    
    shareName: share/AgentGroupName    
    readOnly: false
```

You can learn more about the [Azure File Share for AKS from Microsoft's documentation](https://docs.microsoft.com/en-us/azure/aks/azure-files-volume).


---

# 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.frends.com/reference/architecture/agent-storage-availability.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.
