apiVersion: apps/v1
kind: Deployment
metadata:
  name: newrelic-alert-manager
  namespace: newrelic-alert-manager
spec:
  replicas: 1
  selector:
    matchLabels:
      name: newrelic-alert-manager
  template:
    metadata:
      labels:
        name: newrelic-alert-manager
    spec:
      serviceAccountName: newrelic-alert-manager
      containers:
        - name: newrelic-alert-manager
          image: personio/newrelic-alert-manager:1.5.1
          command:
            - newrelic-alert-manager
          imagePullPolicy: Always
          env:
            - name: OPERATOR_NAME
              value: .newrelic-alert-manager
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: NEWRELIC_ADMIN_KEY
              valueFrom:
                secretKeyRef:
                  name: newrelic-alert-manager
                  key: adminKey
            - name: DEFAULT_SLACK_WEBHOOK_URL
              valueFrom:
                secretKeyRef:
                  name: newrelic-alert-manager
                  key: defaultSlackWebhookUrl
            - name: DEFAULT_OPS_GENIE_API_KEY
              valueFrom:
                secretKeyRef:
                  name: newrelic-alert-manager
                  key: defaultOpsgenieApiKey
          resources:
            requests:
              cpu: "0.5"
              memory: "300Mi"
            limits:
              cpu: "0.5"
              memory: "300Mi"