Startup Probe — check if application has started.
1apiVersion: apps/v12kind: Deployment3metadata:4 name: myapp5spec:6 replicas: 37 template:8 spec:9 containers:10 - name: app11 image: myapp:latest12 startupProbe:13 httpGet:14 path: /healthz15 port: 808016 failureThreshold: 3017 periodSeconds: 1018 initialDelaySeconds: 519 timeoutSeconds: 320 successThreshold: 121 readinessProbe:22 httpGet:23 path: /ready24 port: 808025 periodSeconds: 1026 successThreshold: 127 failureThreshold: 328 livenessProbe:29 httpGet:30 path: /healthz31 port: 808032 periodSeconds: 2033 successThreshold: 134 failureThreshold: 335---36# TCP startup probe37apiVersion: apps/v138kind: Deployment39metadata:40 name: myapp-tcp41spec:42 template:43 spec:44 containers:45 - name: app46 image: myapp:latest47 startupProbe:48 tcpSocket:49 port: 808050 failureThreshold: 3051 periodSeconds: 1052---53# Exec startup probe54apiVersion: apps/v155kind: Deployment56metadata:57 name: myapp-exec58spec:59 template:60 spec:61 containers:62 - name: app63 image: myapp:latest64 startupProbe:65 exec:66 command:67 - sh68 - -c69 - "cat /tmp/started"70 failureThreshold: 3071 periodSeconds: 10
1# Check startup probe2kubectl describe pod my-pod | grep -A 10 "startupProbe"34# Check probe status5kubectl get pod my-pod -o jsonpath='{.status.conditions}' | jq67# View startup logs8kubectl logs my-pod --previous910# Check container ready state11kubectl get pod my-pod -o jsonpath='{.status.containerStatuses[0].ready}'1213# Verify startup probe passed14kubectl get pod my-pod -o jsonpath='{.status.containerStatuses[0].started}'
Behavior:
vs Liveness/Readiness: