apiVersion: apps/v1
kind: Deployment
metadata:
  name: docker-registry
  labels:
    name: docker-registry
    app: docker-registry
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: docker-registry
  template:
    metadata:
      labels:
        app: docker-registry
        name: docker-registry
    spec:
      volumes:
        - name: config
          configMap:
            name: docker-registry
        - name: storage
          hostPath:
            path: /var/k8s/docker-registry
      containers:
        - name: app
          image: registry:2
          ports:
            - containerPort: 5000
          volumeMounts:
            - name: config
              mountPath: /etc/docker/registry
              readOnly: true
            - name: storage
              mountPath: /var/lib/registry
          livenessProbe:
            httpGet:
              port: 5000
              path: /
