Tree types of probes
startup, readiness, liveness
What does readiness probe determines?
whether or not a container is ready to serve requests
What happens if an app fails readiness probe?
OpenShift removes the IP address for the container from the endpoints of all services.
What happens container fails liveness probe?
OCP kills the container and tries to redeploy it
Readiness probe config key
spec.containers.readinessprobe
Liveness probe config key
spec.containers.livenessprobe
Five options that control probes
Three protocols for probe execution
How do you edit deployment using the GUI
Edith the deployment YAML by going to Workloads → Deployment →
Create http readiness probe using oc
oc set probe deployment myapp –readiness –get-url=http://:8080/healthz –period=20
Create tcp liveness probe using oc
oc set probe deployment myapp –liveness –open-tcp=3306 –period=20 –timeout-seconds=1
Get help with probe creation
oc set probe –help
What is the use of DeploymentConfig?
Enables you to use additional features, such as
Two types of deployment strategies
Change deployment strategy with oc
oc patch dc/mysql –patch ‘{“spec”:{“strategy”:{“type”:”Recreate”}}}’
Continuously run “oc get pods”
watch -n 2 oc get pods
Set an env variable on a dc
oc set env dc/mysql HOOK_RETRIES=5
Start a deployment
oc rollout latest dc/name
view the history of deployments
oc rollout history dc/name
See details of a specific deployment
oc rollout history dc/name –revision=1
Retry a deployment that failed previously
oc rollout retry dc/name
scale the number of pods in a deployment
oc scale dc/name –replicas=3
Two types of events that trigger a deployment:
Set a deployment trigger for a deployment configuration
oc set triggers dc/name –from-image=myproject/origin-ruby-sample:latest -c helloworld