---
apiVersion: apps/v1
kind: Deployment

metadata:
  namespace: default
  name: registry
  labels:
    app.kubernetes.io/instance: registry

spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: registry
  template:
    metadata:
      labels:
        app: registry
    spec:
      containers:
      - name: registry
        image: registry:2
        imagePullPolicy: IfNotPresent
        env:
        - name: REGISTRY_STORAGE_DELETE_ENABLED
          value: "true"

        volumeMounts:
        - name: data-registry
          mountPath: /var/lib/registry

      volumes:
      - name: data-registry
        hostPath:
          path: /data/kube/registry
          type: DirectoryOrCreate
