restore-from-empty.yaml 828 Bytes
apiVersion: batch/v1
kind: Job
metadata:
  name: mariadb-restore-from-empty
spec:
  #replicas: 1
  #progressDeadlineSeconds: 600
  template:
    spec:
      restartPolicy: OnFailure
      securityContext:
        runAsUser: 0
        runAsGroup: 0

      volumes:
        - name: mariadb-entrypoint-initdb
          persistentVolumeClaim:
            claimName: mariadb-entrypoint-initdb
        - name: mariadb-scripts
          configMap:
            name: mariadb-scripts
            defaultMode: 0755

      containers:
        - name: restore-from-empty
          image: debian
          command: ["/scripts/restore-from-empty"]
          volumeMounts:
            - name: mariadb-entrypoint-initdb
              mountPath: /docker-entrypoint-initdb.d
            - name: mariadb-scripts
              mountPath: /scripts