apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: prometheus
spec:
  selector:
    matchLabels:
      app: prometheus
  serviceName: prometheus
  replicas: 1
  template:
    metadata:
      labels:
        app: prometheus
    spec:
      serviceAccountName: prometheus
      terminationGracePeriodSeconds: 10
      containers:
      - name: prometheus
        image: prom/prometheus:v2.15.2
        ports:
          - containerPort: 9090
            name: prometheus
        volumeMounts:
          - mountPath: /etc/prometheus
            name: prometheus-yaml
      volumes:
        - name: prometheus-yaml
          configMap:
            name: prometheus
            items:
            - key: prometheus-config.yaml
              path: prometheus.yml
            - key: alert.rules.yaml
              path: alert.rules.yaml

