---
kind: Namespace
apiVersion: v1
metadata:
  name: oadp-restore-issue
  labels:
    app: oadp-restore-issue

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: oadp-restore-issue
  namespace: oadp-restore-issue
  labels:
    app: oadp-restore-issue
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  volumeMode: Filesystem

---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: oadp-restore-issue
  namespace: oadp-restore-issue
  annotations:
    image.openshift.io/triggers: '[{
        "fieldPath": "spec.template.spec.containers[?(@.name==\"oadp-restore-issue\")].image",
        "from": {
          "kind": "ImageStreamTag",
          "name": "mariadb:latest",
          "namespace": "openshift"
        }
      }]'
  labels:
    app: oadp-restore-issue
spec:
  replicas: 1
  selector:
    matchLabels:
      app: oadp-restore-issue
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: oadp-restore-issue
    spec:
      containers:
        - name: oadp-restore-issue
          image: image-registry.openshift-image-registry.svc:5000/openshift/mariadb:latest
          volumeMounts:
            - name: oadp-restore-issue
              mountPath: /var/lib/mysql/data
          env:
            - name: MYSQL_DATABASE
              value: oadp_restore_issue
            - name: MYSQL_USER
              value: oadp_restore_issue
            - name: MYSQL_PASSWORD
              value: oadp_restore_issue
          livenessProbe:
            exec:
              command:
                - mysqladmin
                - --user=root
                - ping
            initialDelaySeconds: 30
          readinessProbe:
            exec:
              command:
                - /bin/sh
                - -c
                - mysqladmin --host='127.0.0.1' --user="${MYSQL_USER}" --password="${MYSQL_PASSWORD}" ping
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop: [ALL]
      volumes:
        - name: oadp-restore-issue
          persistentVolumeClaim:
            claimName: oadp-restore-issue
