apiVersion: v1
kind: ReplicationController
metadata:
  name: docker-registry
spec:
  replicas: 1
  selector:
    name: docker-registry
  template:
    metadata:
      labels:
        name: docker-registry
    spec:
      containers:
      - image: registry:2
        ports:
          - containerPort: 5000
        imagePullPolicy: IfNotPresent
        name: registry
        volumeMounts:
          # name must match the volume name below
          - name: docker-registry
            mountPath: "/var/lib/registry"
      volumes:
      - name: docker-registry
        persistentVolumeClaim:
          claimName: docker-registry
