• Sidecar を 2 つ作成 • Sidecar に Probe を設定 ◦ Startup probe ◦ Readiness probe apiVersion: v1 kind: Pod metadata: name: pod-with-sidecar spec: initContainers: - name: sidecar-1 image: cgr.dev/chainguard/wolfi-base:latest restartPolicy: Always command: ["ash", "-c", "trap 'echo Terminated; exit' TERM; echo Started; while true; do sleep 1; done"] startupProbe: exec: command: ["ash", "-c", "echo StartupProbe Started > /proc/1/fd/1; sleep 5; echo Ready > /proc/1/fd/1"] initialDelaySeconds: 5 timeoutSeconds: 8 periodSeconds: 10 - name: sidecar-2 image: cgr.dev/chainguard/wolfi-base:latest restartPolicy: Always command: ["ash", "-c", "trap 'echo Terminated; exit' TERM; echo Started; while true; do sleep 1; done"] readinessProbe: exec: command: ["ash", "-c", "echo ReadinessProbe Started > /proc/1/fd/1; sleep 5; echo Ready > /proc/1/fd/1"] initialDelaySeconds: 5 timeoutSeconds: 8 periodSeconds: 10 containers: - name: regular-1 image: cgr.dev/chainguard/wolfi-base:latest command: ["ash", "-c", "trap 'echo Terminated; exit' TERM; echo Started; while true; do sleep 1; done"] ※ Kubernetes 1.28 時点の実装