apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    description: Collects metrics and aggregates them into graphs.
  labels:
    deploy: prometheus
  name: prometheus
spec:
  minReadySeconds: 10
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: prometheus
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: prometheus
    spec:
      containers:
      - args:
        - -alertmanager.url=http://alertmanager
        - -config.file=/etc/prometheus/prometheus.yml
        - -storage.local.path=/prometheus/data
        - -web.console.libraries=/etc/prometheus/console_libraries
        - -web.console.templates=/etc/prometheus/consoles
        image: sourcegraph/prometheus:v1.4.1@sha256:1a02878ac9a0f532a68673bda93d406b21786706446c42a40cb3ed3e867278c0
        name: prometheus
        ports:
        - containerPort: 9090
          name: http
        resources:
          limits:
            cpu: "4"
            memory: 8Gi
          requests:
            cpu: 500m
            memory: 2Gi
        volumeMounts:
        - mountPath: /prometheus
          name: data
        - mountPath: /etc/prometheus
          name: config
      - args:
        - --volume-dir=/etc/prometheus
        - --webhook-url=http://localhost:9090/-/reload
        image: sourcegraph/configmap-reload:v0.1@sha256:dc40dccdaa22cd28a77fc2a53a765c59d315c6828b2bbe51a40416954b6d3705
        name: configmap-reload
        resources:
          limits:
            cpu: 10m
            memory: 10Mi
          requests:
            cpu: 10m
            memory: 10Mi
        volumeMounts:
        - mountPath: /etc/prometheus
          name: config
          readOnly: true
      serviceAccountName: prometheus
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: prometheus
      - configMap:
          defaultMode: 464
          name: prometheus
        name: config
