Wait Pattern — init containers waiting for dependencies.
1apiVersion: apps/v12kind: Deployment3metadata:4 name: myapp5spec:6 template:7 spec:8 initContainers:9 - name: wait-for-db10 image: busybox:1.3611 command: ["sh", "-c", "until nc -z postgres-service 5432; do sleep 2; done"]12 - name: wait-for-redis13 image: busybox:1.3614 command: ["sh", "-c", "until nc -z redis-service 6379; do sleep 2; done"]15 containers:16 - name: app17 image: myapp:latest
1kubectl get pod my-pod -o jsonpath='{.status.initContainerStatuses}' | jq
Use cases: DB readiness, config loading, service discovery.