---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pdbmux
  namespace: pdbmux
  annotations:
    configmap.reloader.stakater.com/auto: "true"
spec:
  replicas: 2
  selector:
    matchLabels:
      app: pdbmux
  strategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: pdbmux
    spec:
      automountServiceAccountToken: false
      containers:
        - name: pdbmux
          # Image is published by the pdbmux repo's .woodpecker/docker.yaml on
          # a v* tag. It only exists after that tag is cut (see PR merge gates).
          image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/pdbmux:v0.1.0
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
          envFrom:
            # PDBMUX_LISTEN / PDBMUX_BACKENDS / PDBMUX_PRIMARY / PDBMUX_PREFER /
            # PDBMUX_MERGE
            - configMapRef:
                name: pdbmux-env
                optional: false
          livenessProbe:
            httpGet:
              path: /healthz
              port: http
            initialDelaySeconds: 15
            periodSeconds: 30
            timeoutSeconds: 5
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 5
            failureThreshold: 3
          resources:
            requests:
              cpu: 50m
              memory: 64Mi
            limits:
              cpu: 500m
              memory: 256Mi
      restartPolicy: Always
