---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: healthz
  labels:
    app: healthz
spec:
  replicas: 3
  selector:
    matchLabels:
      app: healthz
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/default-container: app
      labels:
        app: healthz
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app
                      operator: In
                      values:
                        - healthz
                topologyKey: topology.kubernetes.io/zone
              weight: 100
      serviceAccountName: healthz
      containers:
        - name: app
          image: ghcr.io/binkhq/healthz:latest
          resources:
            limits:
              cpu: 250m
              memory: 16Mi
            requests:
              cpu: 250m
              memory: 16Mi
          livenessProbe:
            httpGet:
              path: /healthz
              port: 6502
              scheme: HTTP
            initialDelaySeconds: 2
          readinessProbe:
            httpGet:
              path: /healthz
              port: 6502
              scheme: HTTP
            initialDelaySeconds: 2
          ports:
            - name: http
              containerPort: 6502
