apiVersion: v1
kind: ReplicationController
metadata:
  annotations:
    qingyuanos.io/catalog-by: '{"version": "v1alpha", "lib": "https://github.com/qingyuancloud/harpoon"'
  labels:
    app: registry
    heritage: qingyuancloud.com
    name: registry
  name: registry
  # namespace: harpoon
spec:
  replicas: 1
  selector:
    name: registry
  template:
    metadata:
      labels:
        name: registry
    spec:
      containers:
      - image: registry
        imagePullPolicy: IfNotPresent
        name: registry
        env:
        - name: REGISTRY_HTTP_TLS_CERTIFICATE
          value: /certs/registry-ca.crt
        - name: REGISTRY_HTTP_TLS_KEY
          value: /certs/registry-ca.key
        - name: DOCKER_REGISTRY_CONFIG
          value: /etc/docker/registry/config.yml
        - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
          value: /var/lib/registry
        ports:
        - containerPort: 5000
        volumeMounts:
        - mountPath: /auth
          name: registry-basicauth
          readOnly: true
        # - mountPath: /certs/ca.crt
        #   name: registry-ca-crt-selfsigned
        # - mountPath: /certs/ca.key
        #   name: registry-ca-key-selfsigned
        - mountPath: /certs
          name: registry-ca-selfsigned
        - mountPath: /etc/docker/registry # /config.yml
          name: registry-config # registry-config-path
        - mountPath: /var/lib/registry
          name: registry-repo
      volumes:
      - name: registry-basicauth
        secret:
          secretName: registry-htpasswd
          items:
          - key: htpasswd
            path: htpasswd
      - hostPath:
          path: /data/src/github.com/openshift/origin/etc/paas/registry-ca.crt
        name: registry-ca-crt-selfsigned
      - hostPath:
          path: /data/src/github.com/openshift/origin/etc/paas/registry-ca.key
        name: registry-ca-key-selfsigned
      - hostPath:
          path: /data/src/github.com/openshift/origin/etc/paas
        name: registry-ca-selfsigned
      - configMap:
          name: registry-config
          items:
          - key: config-yml
            path: config.yml
        name: registry-config
      - hostPath:
          path: /data/src/github.com/openshift/origin/etc/paas/registry-config.yml
        name: registry-config-path
      - hostPath:
          path: /data/src/github.com/openshift/origin/registry-repo
        name: registry-repo
