apiVersion: apps/v1
kind: Deployment
metadata:
  name: alertmanager-deployment
  labels:
     app: alertmanager
spec:
   replicas: 1
   selector:
     matchLabels:
       app: alertmanager
   template:
      metadata:
         labels:
           app: alertmanager
      spec:
        containers:
         - name: alertmanager
           image: prom/alertmanager:v0.21.0
           args:
             - --cluster.advertise-address=127.0.0.1:9093
             - --config.file=/etc/alertmanager/alertmanager.yml
           volumeMounts:
              - name: alertmanager-config
                mountPath: /etc/alertmanager/alertmanager.yml
                subPath: alertmanager.yml
           ports:
           - containerPort: 9093
        serviceAccount: alertmanager
        serviceAccountName: alertmanager
        volumes:
         - name: alertmanager-config
           configMap:
             name: alertmanager-config