apiVersion: v1
kind: ReplicationController
metadata:
  labels:
    name: prometheus
  name: prometheus
  namespace: default
spec:
  replicas: 1
  selector:
    name: prometheus
  template:
    metadata:
      labels:
        kubernetes.io/color: E5CCFF
        name: prometheus
    spec:
      containers:
      - env:
        - name: DATABASE_URL
          value: sqlite3:/promdash/file.sqlite3
        image: quay.io/samsung_ag/promdash:latest
        imagePullPolicy: Always
        name: promdash
        ports:
        - containerPort: 3000
          hostPort: 3000
          protocol: TCP
        volumeMounts:
        - mountPath: /promdash
          name: data
      - args:
        - -t
        - PROMETHEUS,KUBE_APISERVER,KUBE_CONTROLLER,KUBE_SCHEDULER,KUBE_ETCD,MASTER_CADVISOR,ETCD_CADVISOR,PUSHGATEWAY
        - -d
        - /var/prometheus
        - -K
        env:
        - name: PROMETHEUS_TARGET_ADDRESS
          value: localhost:9090
        # XXX: don't expect this to gather sane data once there are N apiserver's behind the master
        - name: KUBE_APISERVER_TARGET_ADDRESS
          value: $KUBE_MASTER_IP:8080
        - name: KUBE_CONTROLLER_TARGET_ADDRESS
          value: $KUBE_CONTROLLER_IP:10252
        - name: KUBE_SCHEDULER_TARGET_ADDRESS
          value: $KUBE_SCHEDULER_IP:10251
        - name: KUBE_ETCD_TARGET_ADDRESS
          value: $KUBE_ETCD_IP:4001
        - name: MASTER_CADVISOR_TARGET_ADDRESS
          value: $KUBE_MASTER_IP:8094
        - name: ETCD_CADVISOR_TARGET_ADDRESS
          value: $KUBE_ETCD_IP:8094
        - name: PUSHGATEWAY_TARGET_ADDRESS
          value: localhost:9091
        image: quay.io/samsung_ag/prometheus:latest
        imagePullPolicy: Always
        name: prometheus
        ports:
        - containerPort: 9090
          hostPort: 9090
          protocol: TCP
        volumeMounts:
        - mountPath: /var/prometheus/
          name: data
      - image: "prom/pushgateway:latest"
        name:  pushgateway
        ports:
        - containerPort: 9091
          hostPort: 9091
          protocol: TCP
      dnsPolicy: ClusterFirst
      nodeSelector:
        kraken-node: node-001
      restartPolicy: Always
      volumes:
      - name: data 
        emptyDir: {}
