apiVersion: v1
kind: ReplicationController
metadata:
  name: deis-builder
  namespace: deis
  labels:
    heritage: deis
spec:
  replicas: 1
  selector:
    app: deis-builder
  template:
    metadata:
      labels:
        app: deis-builder
    spec:
      containers:
        - name: deis-builder
          image: quay.io/deisci/builder:v2-beta
          imagePullPolicy: Always
          ports:
            - containerPort: 2223
              name: ssh
            - containerPort: 3000
              name: fetcher
            - containerPort: 8092
              name: healthsrv
          env:
            - name: "HEALTH_SERVER_PORT"
              value: "8092"
            - name: "EXTERNAL_PORT"
              value: "2223"
            # This var needs to be passed so that the minio client (https://github.com/minio/mc) will work in Alpine linux
            - name: "DOCKERIMAGE"
              value: "1"
            - name: "DEBUG"
              value: "true"
            - name: "POD_NAMESPACE"
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          volumeMounts:
            - name: minio-user
              mountPath: /var/run/secrets/object/store
              readOnly: true
            - name: builder-key-auth
              mountPath: /var/run/secrets/api/auth
              readOnly: true
      volumes:
        - name: minio-user
          secret:
            secretName: minio-user
        - name: builder-key-auth
          secret:
            secretName: builder-key-auth
