apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: prometheus
  name: prometheus
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prometheus-server
  template:
    metadata:
      labels:
        app: prometheus-server
    spec:
      serviceAccountName: prometheus
      containers:
        - name: prometheus
          image: prom/prometheus:v2.1.0
          imagePullPolicy: Always
          ports:
            - containerPort: 9090
              protocol: TCP
          volumeMounts:
            - mountPath: "/etc/prometheus"
              name: config-prometheus
      volumes:
        - name: config-prometheus
          configMap:
            name: prometheus-config