# Source: prometheus/templates/alertmanager/deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    component: "alertmanager"
    app: prometheus
    release: prometheus
    chart: prometheus-13.6.0
    heritage: Helm
    gitops.jenkins-x.io/pipeline: 'namespaces'
  name: prometheus-alertmanager
  namespace: jx-observability
  annotations:
    wave.pusher.com/update-on-config-change: 'true'
spec:
  selector:
    matchLabels:
      component: "alertmanager"
      app: prometheus
      release: prometheus
  replicas: 1
  template:
    metadata:
      labels:
        component: "alertmanager"
        app: prometheus
        release: prometheus
        chart: prometheus-13.6.0
        heritage: Helm
    spec:
      serviceAccountName: prometheus-alertmanager
      containers:
        - name: prometheus-alertmanager
          image: "quay.io/prometheus/alertmanager:v0.21.0"
          imagePullPolicy: "IfNotPresent"
          env:
            - name: POD_IP
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.podIP
          args:
            - --config.file=/etc/config/alertmanager.yml
            - --storage.path=/data
            - --cluster.advertise-address=[$(POD_IP)]:6783
            - --web.external-url=http://localhost:9093
          ports:
            - containerPort: 9093
          readinessProbe:
            httpGet:
              path: /-/ready
              port: 9093
            initialDelaySeconds: 30
            timeoutSeconds: 30
          resources: {}
          volumeMounts:
            - name: config-volume
              mountPath: /etc/config
            - name: storage-volume
              mountPath: "/data"
              subPath: ""
        - name: prometheus-alertmanager-configmap-reload
          image: "jimmidyson/configmap-reload:v0.5.0"
          imagePullPolicy: "IfNotPresent"
          args:
            - --volume-dir=/etc/config
            - --webhook-url=http://127.0.0.1:9093/-/reload
          resources: {}
          volumeMounts:
            - name: config-volume
              mountPath: /etc/config
              readOnly: true
      securityContext:
        fsGroup: 65534
        runAsGroup: 65534
        runAsNonRoot: true
        runAsUser: 65534
      volumes:
        - name: config-volume
          configMap:
            name: prometheus-alertmanager
        - name: storage-volume
          persistentVolumeClaim:
            claimName: prometheus-alertmanager
