Kubernetes Probes – Startup Readiness Liveness – with examples – CKA Training – Kubernetes Training

Kubernetes provides probes (health checks) to monitor and act on the state of Pods (Containers) and to make sure only healthy Pods serve traffic. With help of Probes, we can control when a pod should be deemed started, ready for service, or live to serve traffic. Probes are used to detect: 1. Containers which are yet to start and so can’t take traffic 2. Containers which are overloaded and can’t take any more traffic 3. Containers which are dead and need a reboot, that might help in reviving the container There are currently three types of probes in Kubernetes: ## Startup Probe A startup probe verifies whether the application within a container is started. Startup probes run before any other probe, and, unless it finishes successfully, disables other probes. If a container fails its startup probe, then the container is killed and follows the pod’s restartPolicy. This type of probe is only executed at startup, unlike readiness probes, which are run periodically. The startup probe is configured in the spec.containers.startupprobe attribute of the pod configuration. ## Readiness Probe Readiness probes determine whether or not a container is ready to serve requests. If the readiness probe returns a failed state, then Kubernetes removes the IP address for the container from the endpoints of all Services. Developers use readiness probes to instruct Kubernetes that a running container should not receive any traffic. This is useful when waiting for an application to perform time-consuming initial tasks, such as establishing network connections, loading files, and warming caches. The readiness probe is configured in the spec.containers.readinessprobe attribute of the pod configuration. ## Liveness Probe Liveness probes determine whether or not an application running in a container is in a healthy state. If the liveness probe detects an unhealthy state, then Kubernetes kills the container and tries to redeploy it. The liveness probe is configured in the spec.containers.livenessprobe attribute of the pod configuration. “““““““` visit our website – https://networknuts.net our facebook – /networknuts our instagram – /networknuts

error: Content is protected !!