0
0
Kubernetesdevops~15 mins

Pod Disruption Budgets in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Pod Disruption Budgets
📖 Scenario: You manage a Kubernetes cluster running a web application. To keep the app reliable during maintenance, you want to control how many pods can be disrupted at once.
🎯 Goal: Create a Pod Disruption Budget (PDB) YAML manifest that limits disruptions to your app pods, ensuring at least one pod is always available during voluntary disruptions.
📋 What You'll Learn
Create a YAML manifest named pdb.yaml for a Pod Disruption Budget
Set minAvailable to 1 to keep at least one pod running
Target pods with the label app: webapp
Use the policy/v1 API version
Name the PDB webapp-pdb
💡 Why This Matters
🌍 Real World
Pod Disruption Budgets help maintain application availability during planned maintenance or upgrades by limiting how many pods can be taken down at once.
💼 Career
Understanding PDBs is essential for Kubernetes administrators and DevOps engineers to ensure high availability and reliability of applications in production environments.
Progress0 / 4 steps
1
Create the basic YAML structure for the Pod Disruption Budget
Create a YAML file named pdb.yaml with the following keys: apiVersion set to policy/v1, kind set to PodDisruptionBudget, and metadata with name set to webapp-pdb.
Kubernetes
Need a hint?

Start by defining the API version, kind, and metadata name exactly as specified.

2
Add the spec section with minAvailable
Add a spec section to pdb.yaml with minAvailable set to 1.
Kubernetes
Need a hint?

Indent minAvailable under spec exactly with value 1.

3
Add the selector to target pods with label app: webapp
Under spec, add a selector with matchLabels targeting pods labeled app: webapp.
Kubernetes
Need a hint?

Indent selector and matchLabels properly under spec.

4
Display the complete Pod Disruption Budget YAML
Print the contents of pdb.yaml to verify the Pod Disruption Budget manifest.
Kubernetes
Need a hint?

Use cat pdb.yaml in your terminal to display the file content.