OpenShift Health Probes¶
Introduction¶
Health probes decide when OpenShift sends traffic to a pod and when the kubelet restarts it. Bad probe paths, slow startup, or missing ports can make a healthy application look broken.
Before You Start¶
Make sure you are in the correct project and know whether the application is driven by a Deployment, DeploymentConfig, BuildConfig, ImageStream, or external registry image.
Practical Examples¶
oc describe deployment web -n app
oc set probe deployment/web --readiness --get-url=http://:8080/ready -n app
oc set probe deployment/web --liveness --get-url=http://:8080/health -n app
oc rollout status deployment/web -n app
Example output:
deployment.apps/web probes updated
deployment "web" successfully rolled out
Example YAML¶
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
Verification¶
oc describe pod -l app=web -n app
oc get events -n app --field-selector involvedObject.kind=Pod
oc exec deploy/web -n app -- curl -sS http://127.0.0.1:8080/ready
Troubleshooting¶
Check probe paths from inside the pod, review readiness and liveness events, then adjust probe timing or endpoints based on the application startup behavior.
Common Mistakes¶
- Using a liveness probe for slow dependency checks.
- Setting initialDelaySeconds too low for JVM or large applications.
- Pointing probes at a route instead of the local container endpoint.
Quick Checklist¶
- Confirm the active project.
- Inspect the exact object named in the error.
- Read recent events.
- Apply one focused fix.
- Verify status after the change.
Related Guides¶
- Openshift New App Explained
- Openshift Imagestream Explained
- Openshift Application Deployment Checklist
Summary¶
OpenShift Health Probes should be verified with commands that match the OpenShift object being changed or investigated.