---
apiVersion: v1
kind: Service
metadata:
  name: prometheus
  labels:
    app: prometheus
spec:
  clusterIP: None
  selector:
    app: prometheus
  ports:
    - port: 9090
      name: dashboard
      protocol: TCP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: prometheus
spec:
  selector:
    matchLabels:
      app: prometheus
  serviceName: prometheus
  template:
    metadata:
      labels:
        app: prometheus
    spec:
      restartPolicy: Always
      terminationGracePeriodSeconds: 0
      containers:
        - name: prometheus
          image: prometheus
          readinessProbe:
            tcpSocket:
              port: 9090
            periodSeconds: 1
            failureThreshold: 300
          ports:
            - containerPort: 9090
              name: dashboard
              protocol: TCP
          command:
            - "prometheus"
            - "--config.file=prometheus_config.yaml"
            - "--web.external-url=http://[::]:9090"
