restore-from-empty.yaml
849 Bytes
apiVersion: batch/v1
kind: Job
metadata:
name: postgresql-restore-from-empty
spec:
#replicas: 1
#progressDeadlineSeconds: 600
template:
spec:
restartPolicy: OnFailure
securityContext:
runAsUser: 0
runAsGroup: 0
volumes:
- name: postgresql-entrypoint-initdb
persistentVolumeClaim:
claimName: postgresql-entrypoint-initdb
- name: postgresql-scripts
configMap:
name: postgresql-scripts
defaultMode: 0755
containers:
- name: restore-from-empty
image: debian
command: ["/scripts/restore-from-empty"]
volumeMounts:
- name: postgresql-entrypoint-initdb
mountPath: /docker-entrypoint-initdb.d
- name: postgresql-scripts
mountPath: /scripts