apiVersion: v1
kind: ReplicationController
metadata:
  name: registry-creds
  namespace: kube-system
  labels:
    version: v1.6
spec:
  replicas: 1
  selector:
    name: registry-creds
    version: v1.9
  template:
    metadata:
      labels:
        name: registry-creds
        version: v1.9
    spec:
      containers:
      - image: upmcenterprises/registry-creds:1.9
        name: registry-creds
        imagePullPolicy: Always
        env:
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: AWS_ACCESS_KEY_ID
          - name: AWS_SECRET_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: AWS_SECRET_ACCESS_KEY
          - name: awsaccount
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws-account
          - name: awsregion
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws-region
          - name: aws_assume_role
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws_assume_role
          - name: DOCKER_PRIVATE_REGISTRY_PASSWORD
            valueFrom:
              secretKeyRef:
                name: registry-creds-dpr
                key: DOCKER_PRIVATE_REGISTRY_PASSWORD
          - name: DOCKER_PRIVATE_REGISTRY_SERVER
            valueFrom:
              secretKeyRef:
                name: registry-creds-dpr
                key: DOCKER_PRIVATE_REGISTRY_SERVER
          - name: DOCKER_PRIVATE_REGISTRY_USER
            valueFrom:
              secretKeyRef:
                name: registry-creds-dpr
                key: DOCKER_PRIVATE_REGISTRY_USER
        volumeMounts:
        - name: gcr-creds
          mountPath: "/root/.config/gcloud"
          readOnly: true
      volumes:
      - name: gcr-creds
        secret:
          secretName: registry-creds-gcr