Drop Site Job

Create a file named drop-site-job.yaml with following content.

apiVersion: batch/v1
kind: Job
metadata:
  name: drop-site-${SITE_NAME}
spec:
  backoffLimit: 1
  template:
    spec:
      securityContext:
        supplementalGroups: [1000]
      containers:
      - name: drop-site
        image: frappe/erpnext-worker:${VERSION}
        args: ["drop"]
        imagePullPolicy: IfNotPresent
        volumeMounts:
          - name: sites-dir
            mountPath: /home/frappe/frappe-bench/sites
        env:
          - name: "SITE_NAME"
            value: ${SITE_NAME}
          - name: "DB_ROOT_USER"
            value: root
          - name: "MYSQL_ROOT_PASSWORD"
            valueFrom:
              secretKeyRef:
                key: password
                name: mariadb-root-password
      restartPolicy: Never
      volumes:
        - name: sites-dir
          persistentVolumeClaim:
            claimName: ${SITES_PVC}
            readOnly: false

Change the following properties:

Create the resource:

$ kubectl create -n <namespace> -f drop-site-job.yaml