Docs Menu
Docs Home
/
MongoDB Enterprise Kubernetes Operator
/

Configure File System Backup Store with Kubernetes Operator

On this page

  • Prerequisites
  • Procedure

Kubernetes Operator supports storage of filesystem snapshots.

To configure file system snapshot storage, your Kubernetes Operator deployment must have a storage class configured with the ReadWriteMany method.

To configure file system snapshot storage:

1

Create a PersistentVolumeClaim object, and allocate storage as needed. Set accessModes to ReadWriteMany:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: snapshot-store-ops-manager
spec:
storageClassName: managed-nfs-storage #SC that supports(RWX)
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10G
...
2

Create an Ops Manager CustomResourceDefinition that specifies your PersistentVolumeClaim object and the backup.fileSystemStores field, which is the name of your file system snapshot store.

The following example creates a CustomResourceDefinition file named ops-manager-fs.yaml, for the MongoDB oplog store with a kube-user.

apiVersion: mongodb.com/v1
kind: MongoDBOpsManager
metadata:
name: ops-manager
spec:
replicas: 1
version: 6.0.7
adminCredentials: ops-manager-admin-secret
statefulSet:
spec:
template:
spec:
volumes:
- name: snapshot-store
persistentVolumeClaim:
claimName: snapshot-store-ops-manager
containers:
- name: mongodb-ops-manager
volumeMounts:
- name: snapshot-store
mountPath: /snapshot_store
backup:
enabled: true
fileSystemStores:
- name: filesystem1
assignmentLabels: ["test1", "test2"]
opLogStores:
assignmentLabels: ["test1", "test2"]
- name: oplog1
mongodbResourceRef:
name: oplog-db
# mongodbUserRef:
# name: kube-user
statefulSet:
spec:
template:
spec:
volumes:
- name: snapshot-store
persistentVolumeClaim:
claimName: snapshot-store-ops-manager
containers:
- name: mongodb-backup-daemon
volumeMounts:
- name: snapshot-store
mountPath: /snapshot_store
applicationDatabase:
members: 3
version: 6.0.0
3

Invoke the following kubectl command on the filename of your Ops Manager resource definition:

kubectl apply -f <opsmgr-resource>.yaml
4

Wait for your Ops Manager object to report its state as Running, then configure your oplog store as described in the Configure Backup Settings step of the Deploy an Ops Manager Resource procedure.

5

Log into your Ops Manager instance and navigate to: Admin Backup Snapshot Store Create New File System Store.

Set the name to the value you set for backup.fileSystemStores in your CustomResourceDefinition. Set the other values as appropriate, then click Create.

Your Ops Manager object will report a BACKUP state of Pending after you create the new file system store.

Back

Configure KMIP Backup Encryption