Mastering Workloads & Scheduling for the CKA Exam: A Comprehensive Guide
The Certified Kubernetes Administrator (CKA) exam emphasizes a solid understanding of workloads and scheduling, accounting for 15% of the total exam. Key areas include managing deployments, performing rolling updates and rollbacks, configuring applications with ConfigMaps and Secrets, scaling applications, creating robust and self-healing deployments, understanding the impact of resource limits on pod scheduling, and knowledge of manifest management and templating tools. This article provides a detailed guide with commands and code snippets to enhance your preparation.
Workloads & Scheduling15%
Understand deployments and how to perform rolling update and rollbacks Use ConfigMaps and Secrets to configure applications Know how to scale applications Understand the primitives used to create robust, self-healing, application deployments Understand how resource limits can affect Pod scheduling Awareness of manifest management and common templating tools
Understanding Deployments: Rolling Updates and Rollbacks
- Deployments manage a set of replica Pods. They support zero-downtime updates and rollbacks.
Rolling Update Command:
- Update the image:
kubectl set image deployment/my-deployment nginx=nginx:1.9.1
Rollback Command:
- Undo an update:
kubectl rollout undo deployment/my-deployment
ConfigMaps and Secrets for Application Configuration
- ConfigMaps store non-sensitive, key-value configuration data.
- Create a ConfigMap:
kubectl create configmap app-config --from-literal=key1=value1Secrets store sensitive data like passwords and SSH keys.
- Create a Secret:
kubectl create secret generic app-secret --from-literal=password=my-passwordScaling Applications
- Applications can be scaled manually or automatically to handle varying loads.
- Manual Scaling Command:
kubectl scale deployment my-deployment --replicas=5Auto-scaling Command:
kubectl autoscale deployment my-deployment --min=2 --max=10 --cpu-percent=80Creating Robust, Self-Healing Deployments
- Use liveness and readiness probes to maintain application health.
- Example YAML Configuration:
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginx
livenessProbe:
httpGet:
path: /healthz
port: 80
readinessProbe:
httpGet:
path: /readiness
port: 80Understanding Resource Limits and Pod Scheduling
- Resource limits and requests influence where and how efficiently pods are scheduled.
- Example YAML Configuration:
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginx
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"Manifest Management and Templating Tools
- Understanding how to manage Kubernetes manifests is crucial for deployment.
- Common Templating Tools:
- Helm: Manages Kubernetes applications through Helm charts.
- Kustomize: Customizes raw, template-free YAML files for multiple purposes.
Conclusion
The CKA exam’s Workloads & Scheduling section demands proficiency in various Kubernetes functionalities. From managing deployments and their scaling to ensuring robust application performance with appropriate resource allocation, the depth of knowledge required is significant. Familiarity with manifest management and templating tools further enhances a Kubernetes administrator’s capabilities. This comprehensive guide aims to equip you with the necessary skills and knowledge to excel in this critical area of the CKA exam.
CKA Cheatsheet:



