apiVersion: apps/v1
kind: Deployment
metadata:
  name: alertmanager
spec:
  replicas: 1
  selector:
    matchLabels:
      app: alertmanager
  template:
    metadata:
      labels:
        app: alertmanager
    spec:
      volumes:
        - name: opt-alertmanager
          persistentVolumeClaim:
            claimName: opt-alertmanager
      serviceAccountName: victoriametrics
      containers:
        - name: alertmanager
          image: docker.io/prom/alertmanager:v0.25.0
          args:
            - --config.file=/alertmanager/alertmanager.yml
            - --web.external-url=https://bigasterisk.com/alertmanager/
            - --web.route-prefix=/
            - --log.level=info
          ports:
          - containerPort: 9093
          volumeMounts:
          - name: opt-alertmanager
            mountPath: /alertmanager
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: "kubernetes.io/hostname"
                operator: In
                values: ["ditto"]
---
apiVersion: v1
kind: Service
metadata:
  name: alertmanager
spec:
  ports:
  - port: 80
    targetPort: 9093
  selector:
    app: alertmanager
