apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
  labels:
    alertmanager: '{{ meta.name }}'
  name: '{{ meta.name }}'
  namespace: '{{ meta.namespace }}'
spec:
  replicas: {{ servicetelemetry_vars.alerting.alertmanager.deployment_size }}
  serviceAccountName: prometheus-k8s
  serviceMonitorSelector:
    matchLabels:
      app: smart-gateway
{% if servicetelemetry_vars.alerting.alertmanager.storage.strategy == "persistent" %}
  storage:
    volumeClaimTemplate:
      spec:
        resources:
          requests:
            storage: {{ servicetelemetry_vars.alerting.alertmanager.storage.persistent.pvc_storage_request }}
{% if servicetelemetry_vars.alerting.alertmanager.storage.persistent.storage_selector %}
        selector: {{ servicetelemetry_vars.alerting.alertmanager.storage.persistent.storage_selector }}
{% endif %}
{% if servicetelemetry_vars.alerting.alertmanager.storage.persistent.storage_class | length %}
        storageClassName: {{ servicetelemetry_vars.alerting.alertmanager.storage.persistent.storage_class }}
{% endif %}
{% endif %}
