apiVersion: apps/v1
kind: Deployment
metadata:
  name: alertmanager-webhook-deployment
  labels:
    app: alertmanager-webhook-lab
spec:
  selector:
    matchLabels:
      app: alertmanager-webhook-pod
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: alertmanager-webhook-pod
    spec:
      # initContainers:
      # Init containers are exactly like regular containers, except:
      # - Init containers always run to completion.
      # - Each init container must complete successfully before the next one starts.
      containers:
        - name: app
          image: $(ALERTMANAGER_WEBHOOK_IMAGE) # app-image
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 128m
              memory: 128Mi
            limits:
              cpu: 256m
              memory: 256Mi
          livenessProbe:
            httpGet:
              path: /api/a/healthz
              port: 3000
            initialDelaySeconds: 30
            timeoutSeconds: 10
            successThreshold: 1
            failureThreshold: 10
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /api/a/healthz
              port: 3000
            initialDelaySeconds: 30
            timeoutSeconds: 10
            successThreshold: 1
            failureThreshold: 10
            periodSeconds: 20
          ports:
            - containerPort: 3000
              name: app3000
      restartPolicy: Always
