Category: Installation
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Kubernetes storage class

Issue

I wanted to know if Appsmith, a platform I am using, uses persistent storage in Kubernetes and what is stored in it. I also wanted to know if it can use a database instead of using the filesystem for MongoDB data.

Resolution

Appsmith uses persistent storage in Kubernetes to store MongoDB data and repos for git-connected applications. The MongoDB data includes users, workspaces, and applications. Appsmith can use a custom MongoDB as well. However, for git-repos, it needs access to the filesystem.

Here is an example of how Appsmith uses the persistent storage in Kubernetes to store MongoDB data:

apiVersion: apps/v1
kind: Deployment
metadata:
name: appsmith-mongodb
spec:
selector:
matchLabels:
app: appsmith-mongodb
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: appsmith-mongodb
spec:
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: mongo-data
containers:
- name: appsmith-mongodb
image: mongo:4
volumeMounts:
- name: mongo-data
mountPath: /data/db

As you can see from the example, a persistent volume claim is created for the MongoDB data. The deployment specifies that the MongoDB container mounts the persistent volume claim and uses it to store its data.

Overall, Appsmith uses persistent storage in Kubernetes to store important data that needs to persist between container restarts. This ensures that the application data is not lost and can be accessed by the application whenever needed.