0
0
Kubernetesdevops~30 mins

Liveness probe concept in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Liveness Probe Concept in Kubernetes
📖 Scenario: You are managing a web application running inside a Kubernetes cluster. To keep the application healthy, you want Kubernetes to check if the app is alive and restart it if it stops responding.
🎯 Goal: Learn how to add a livenessProbe to a Kubernetes pod configuration to automatically detect and recover from application failures.
📋 What You'll Learn
Create a basic pod YAML manifest with a container running nginx
Add a liveness probe configuration using an HTTP GET request
Set probe parameters like initial delay and period
Verify the pod manifest includes the liveness probe correctly
💡 Why This Matters
🌍 Real World
Liveness probes help keep applications running smoothly by letting Kubernetes detect and fix problems automatically.
💼 Career
Understanding liveness probes is essential for Kubernetes administrators and DevOps engineers to maintain healthy containerized applications.
Progress0 / 4 steps
1
Create a basic pod manifest
Create a Kubernetes pod manifest YAML named pod.yaml with a pod named webapp running the nginx:latest container image.
Kubernetes
Need a hint?

Use apiVersion: v1, kind: Pod, and specify metadata.name and spec.containers with the nginx image.

2
Add liveness probe configuration
Add a livenessProbe section under the container in pod.yaml. Use an httpGet probe that checks path / on port 80.
Kubernetes
Need a hint?

Indent livenessProbe under the container and specify httpGet with path and port.

3
Set probe timing parameters
Add initialDelaySeconds: 5 and periodSeconds: 10 under the livenessProbe in pod.yaml to control when and how often the probe runs.
Kubernetes
Need a hint?

Place initialDelaySeconds and periodSeconds at the same level as httpGet inside livenessProbe.

4
Display the final pod manifest
Print the complete contents of pod.yaml to verify the liveness probe is configured correctly.
Kubernetes
Need a hint?

Use multiple print statements to output each line of the YAML manifest exactly as shown.