kind: ReplicationController
apiVersion: v1
metadata:
  name: deis-etcd-discovery
  labels:
    name: deis-etcd-discovery
spec:
  replicas: 1
  selector:
    name: deis-etcd-discovery
  template:
    metadata:
      labels:
        name: deis-etcd-discovery
    spec:
      volumes:
        - name: discovery-token
          secret:
            secretName: deis-etcd-discovery-token
      containers:
        - name: deis-etcd-discovery
          image: quay.io/deisci/etcd:v2-beta
          imagePullPolicy: Always
          command:
            - /usr/local/bin/discovery
          ports:
            - containerPort: 2381
          env:
            - name: DEIS_ETCD_CLUSTER_SIZE
              value: "3"
            - name: ETCD_LISTEN_CLIENT_URLS
              value: http://0.0.0.0:2381
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          volumeMounts:
            - name: discovery-token
              readOnly: true
              mountPath: /var/run/secrets/deis/etcd/discovery
