apiVersion: apps/v1
kind: Deployment
metadata:
  name: c28-probe
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: c28-probe
  template:
    metadata:
      labels:
        app: c28-probe
    spec:
      terminationGracePeriodSeconds: 10
      initContainers:
        - name: init-check
          image: REPLACE_WITH_IMAGE_BY_DIGEST
          command: ["python3", "-c", "import time; time.sleep(2)"]
      containers:
        - name: probe
          image: REPLACE_WITH_IMAGE_BY_DIGEST
          command: ["python3", "/app/probe_app.py", "--host", "0.0.0.0", "--ready-delay", "10", "--state-dir", "/tmp/containers-state"]
          ports:
            - containerPort: 18080
          startupProbe:
            httpGet:
              path: /health
              port: 18080
            periodSeconds: 2
            failureThreshold: 10
          readinessProbe:
            httpGet:
              path: /ready
              port: 18080
            periodSeconds: 2
            failureThreshold: 1
          livenessProbe:
            httpGet:
              path: /health
              port: 18080
            periodSeconds: 5
            failureThreshold: 3
          resources:
            requests:
              cpu: 50m
              memory: 32Mi
            limits:
              cpu: 250m
              memory: 128Mi
          volumeMounts:
            - name: state
              mountPath: /tmp/containers-state
      volumes:
        - name: state
          emptyDir:
            sizeLimit: 16Mi
---
apiVersion: v1
kind: Service
metadata:
  name: c28-probe
spec:
  selector:
    app: c28-probe
  ports:
    - port: 18080
      targetPort: 18080
