Create Backup Sites Job

Create a file named backup-sites.yaml with following content.

apiVersion: batch/v1
kind: Job
metadata:
  name: backup-sites-${TIMESTAMP}
spec:
  backoffLimit: 1
  template:
    spec:
      securityContext:
        supplementalGroups: [1000]
      containers:
      - name: backup-sites
        image: frappe/erpnext-worker:${VERSION}
        args: ["backup"]
        imagePullPolicy: IfNotPresent
        env:
          - name: "WITH_FILES"
            value: "1"
        volumeMounts:
          - name: sites-dir
            mountPath: /home/frappe/frappe-bench/sites
      restartPolicy: Never
      volumes:
        - name: sites-dir
          persistentVolumeClaim:
            claimName: ${SITES_PVC}
            readOnly: false

Change the following properties:

Create the resource:

$ kubectl -n <namespace> -f backup-sites.yaml