0
0
Kubernetesdevops~20 mins

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

Choose your learning style9 modes available
Startup Probe Concept in Kubernetes
📖 Scenario: You are deploying a web application in Kubernetes. Sometimes the app takes time to start before it can respond to health checks. To avoid Kubernetes killing the pod too early, you will use a startupProbe.
🎯 Goal: You will create a Kubernetes pod manifest with a startupProbe that checks the app's readiness by sending an HTTP GET request to /healthz on port 8080. You will configure the probe to wait longer before failing, allowing the app to start properly.
📋 What You'll Learn
Create a pod manifest named web-app with a container named web-container running image nginx.
Add a startupProbe that sends an HTTP GET request to /healthz on port 8080.
Set failureThreshold to 10 and periodSeconds to 5 in the startupProbe.
Print the final pod manifest YAML.
💡 Why This Matters
🌍 Real World
Startup probes are used in Kubernetes to handle applications that take time to start. This prevents Kubernetes from killing pods too early during startup.
💼 Career
Understanding startup probes is important for DevOps roles managing Kubernetes clusters to ensure application stability and proper health monitoring.
Progress0 / 4 steps
1
Create the basic pod manifest
Create a Kubernetes pod manifest with apiVersion set to v1, kind set to Pod, and metadata.name set to web-app. Add a single container named web-container using the image nginx.
Kubernetes
Need a hint?

Start with the basic pod structure and add one container with the specified name and image.

2
Add the startupProbe configuration
Add a startupProbe section under the container web-container. Configure it to send an HTTP GET request to path /healthz on port 8080.
Kubernetes
Need a hint?

Use startupProbe with httpGet specifying the path and port.

3
Configure failureThreshold and periodSeconds
Inside the startupProbe, add failureThreshold set to 10 and periodSeconds set to 5 to control how long Kubernetes waits before marking the pod as failed.
Kubernetes
Need a hint?

These settings tell Kubernetes to try the probe 10 times every 5 seconds before failing.

4
Print the final pod manifest
Print the complete pod manifest YAML with the startupProbe configured as specified.
Kubernetes
Need a hint?

Make sure the entire YAML is printed exactly as configured.