apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: prometheus
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: prometheus
        revision: "20190312001"
    spec:
      containers:
        - name: prometheus
          image: prom/prometheus:v2.8.0
          imagePullPolicy: Always
          resources:
            limits:
              cpu: 100m
              memory: 512Mi
            requests:
              cpu: 100m
              memory: 512Mi
          ports:
            - containerPort: 9090
          readinessProbe:
            httpGet:
              path: /-/ready
              port: 9090
            initialDelaySeconds: 30
            timeoutSeconds: 30
          livenessProbe:
            httpGet:
              path: /-/healthy
              port: 9090
            initialDelaySeconds: 30
            timeoutSeconds: 30
          volumeMounts:
            - name: prometheus-config
              mountPath: /etc/prometheus
          args:
            - "--config.file=/etc/prometheus/config.yml
      volumes:
        - name: prometheus-config
          configMap:
            name: prometheus-config

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-config
data:
  config.yml: |
    scrape_configs:
      - job_name: ichiji-social-sidekiq
        static_configs:
          - targets: ['localhost:9090', '34.95.125.208']

---
apiVersion: v1
kind: Service
metadata:
  name: prometheus
  labels:
    app: prometheus
  annotations:
    service.beta.kubernetes.io/external-traffic: OnlyLocal
spec:
  type: NodePort
  externalTrafficPolicy: Local
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 9090
  selector:
    app: prometheus

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: prometheus
spec:
  backend:
    serviceName: prometheus
    servicePort: 80

Add k8s deployment config for Prometheus
Add k8s deployment config for Prometheus
