Day 46 - Pod Priority And Preemption In Kubernetes
About this video
### Summary of the Video Content on Pod Priority and Preemption: 1. **Introduction**: - The video is part of the "40 Days of CKA" series, focusing on Kubernetes (CKA - Certified Kubernetes Administrator). - The topic for Day 46 is **Pod Priority and Preemption**, a new addition to the CKA curriculum in 2025. 2. **Key Concepts**: - **Pod Priority**: Determines the importance of a pod. Higher priority pods are scheduled before lower priority ones. - **Preemption**: The process where lower priority pods are evicted to make room for higher priority pods when resources are constrained. - **Priority Classes**: Used to define and map priority values. They avoid hardcoding priority numbers in each pod. 3. **Priority Class Fields**: - **Priority Value**: An integer defining the priority level (higher number = higher priority). - **Global Default**: If set to `true`, it becomes the default priority class for pods without a specified priority. - **Preemption Policy**: Defines whether a pod can preempt lower priority pods. Options include `PreemptLowerPriority` (default) or `Never`. 4. **Example Scenario**: - A node with limited resources (e.g., 16 CPUs, 256 GB memory). - Existing pods consume most resources, leaving insufficient space for new pods. - A high-priority pod requires resources, triggering preemption of lower priority pods to free up space. 5. **Demo Setup**: - **Step 1**: Create three priority classes (`high-priority`, `medium-priority`, `low-priority`) with values `1,231,230`, `10,000`, and `1,000`, respectively. - **Step 2**: Set `low-priority` as the global default. - **Step 3**: Deploy pods with different priority classes to observe scheduling behavior. 6. **Resource Constraints**: - A deployment with 5 replicas consumes significant CPU and memory. - A high-priority pod is created, requiring more resources than available. - Lower priority pods are preempted (evicted) to accommodate the high-priority pod. 7. **Observations**: - High-priority pods preempt lower priority ones when resources are insufficient. - Events (`kubectl get events`) show details about preemption, scheduling failures, and resource allocation. 8. **Practical Assignment**: - Create 3 priority classes with different values. - Deploy pods with varying priorities. - Simulate resource constraints to observe preemption behavior. - Document observations from the experiment. 9. **Tools and Environment**: - Use Kubernetes clusters (local setups like Minikube or cloud-based sandboxes). - YAML files define priority classes and pod specifications. - Commands like `kubectl apply`, `kubectl describe`, and `kubectl get events` are used for management and monitoring. 10. **Conclusion**: - Pod priority and preemption ensure critical workloads are prioritized in resource-constrained environments. - Understanding these concepts is essential for managing Kubernetes clusters effectively. - Viewers are encouraged to practice the demo and explore further on their own. This summary provides a structured overview of the video's content, focusing on key concepts, practical implementation, and learning outcomes.
Course: Certified Kubernetes Administrator Full Course For beginners | CKA 2025
This playlist contains the complete CKA series for beginners, based on the latest 2025 curriculum. It includes 40+ videos with hands-on demos, assignments, and exam-based scenarios. We will cover everything from the basics to the Advanced, including fundamental concepts such as Docker, containers, Docker storage and networking, DNS, etc.
View Full Course