Skip to main content

Overview

This challenge set contains 10 practical tasks focused on core Kubernetes concepts including scheduling, workloads, services, RBAC, and storage. These tasks are essential for CKA exam preparation.
Complete these challenges in order. Each builds on fundamental Kubernetes skills you’ll need in the exam.

Task 1: Scheduling - Guaranteed QoS

Objective:Deploy and modify a pod with Guaranteed Quality of Service.
1

Create pod with Guaranteed QoS

Deploy pod named heavy-pod:
  • CPU request: 50m
  • CPU limit: 50m
  • Memory request: 50Mi
  • Memory limit: 50Mi
2

Verify running state

Ensure the pod is in Running state
3

Edit resources

Update the pod’s resources to:
  • CPU: 100m (both request and limit)
  • Memory: 100Mi (both request and limit)
Skills Tested:
  • QoS class configuration
  • Resource requests and limits
  • Pod editing and recreation
For Guaranteed QoS, requests must equal limits for both CPU and memory. Remember that pods cannot be edited in place for resource changes - you’ll need to delete and recreate.

Task 2: Workload & Scheduling - Deployment Revisions

Objective:Analyze deployment revision history to extract specific information.Scenario: The deployment video-app has undergone several rolling updates and rollbacks.Tasks:
  1. Find the total number of revisions
  2. Extract the image name used in the 3rd revision
  3. Record the information in file app-file.txt using format:
    REVISION_TOTAL_COUNT,IMAGE_NAME
    
Example output:
5,nginx:1.19.0
Skills Tested:
  • Deployment revision history
  • Rollout commands
  • File output formatting
Use kubectl rollout history deployment video-app to view revisions. Add --revision=N to see details of a specific revision.

Task 3: Pod & Service Web App

Objective:Create a complete web application with pod, service, and test connectivity.Pod: app-pod
  • Container name: app-container
  • Image: httpd:latest
  • Port: 80
  • Label: app=app-lab
Service: app-svc
  • Type: ClusterIP
  • Port: 80
  • Selector: Matches app-pod
Testing:
  1. Use kubectl port-forward to map local port to the Pod
  2. Use curl to verify the app returns: It works!
Skills Tested:
  • Pod creation with labels
  • Service configuration and selectors
  • Port forwarding
  • Service connectivity testing
Ensure the service selector matches the pod label exactly. Case sensitivity matters.

Task 4: ConfigMap - Basic Creation

Objective:Create a ConfigMap with literal key-value data.ConfigMap: creds
  • Key: username
  • Value: batman
Skills Tested:
  • ConfigMap creation from literal values
  • Imperative command usage
Use kubectl create configmap with the --from-literal flag for quick creation.

Task 5: ConfigMap & Deployment Integration

Objective:Integrate a ConfigMap as environment variables in an existing deployment.Scenario: Deployment webapp-deployment needs dynamic environment variable control.
1

Create ConfigMap

ConfigMap name: webapp-deployment-config-map
APPLICATION=web-app
2

Update deployment

Modify webapp-deployment to inject the ConfigMap data as an environment variable
Skills Tested:
  • ConfigMap creation
  • Environment variable injection
  • Deployment modification
  • ConfigMap references

Task 6: Complete Application Stack with HPA

Objective:Create a complete namespace with deployment, service, and autoscaling configured.Namespace: testDeployment: testing-app
  • Namespace: test
  • Replicas: 3
  • Labels: app=testing-app
  • Node selector: cpu=i5
  • QoS: Burstable (set requests lower than limits)
  • Image: nginx:latest
  • Container port: 80/tcp
Service: testing-app-svc
  • Type: ClusterIP
  • Port: 80
  • Selector: app=testing-app
HorizontalPodAutoscaler: testing-app-hpa
  • Min pods: 3
  • Max pods: 10
  • CPU utilization target: 20%
  • Scale-down behavior:
    • Stabilization window: 30s
    • Max pods removed per interval: 1 pod per 20s
  • Scale-up behavior:
    • Stabilization window: 20s
    • Max pods added per interval: 1 pod per 30s
Skills Tested:
  • Namespace creation
  • Deployment with node selectors
  • QoS configuration (Burstable)
  • Service creation
  • HPA with custom scaling policies
This is a comprehensive task. Break it down into steps: namespace → deployment → service → HPA. Verify each component before proceeding.

Task 7: Priority Classes

Objective:Create a PriorityClass and use it in a deployment.
1

Create PriorityClass

Name: high-valueValue: 2 less than maximum allowed (typically 1000000000 - 2 = 999999998)
2

Create deployment

Deployment: high-value-application
  • Image: lovelearnlinux/webserver:v1
  • Replicas: 3
  • Label: app=webapp
  • Priority class: high-value
Skills Tested:
  • PriorityClass creation
  • Priority value configuration
  • Deployment with priority class assignment
  • Pod scheduling priority
Check the maximum priority value with kubectl get priorityclasses before creating your custom class.

Task 8: ConfigMap with HTML Template

Objective:Mount a ConfigMap as a file volume and update it dynamically.Namespace: prodConfigMap: welcome
<html>
<title>sample application using configmap</title>
<h1>welcome to our test environment</h1>
</html>
Deployment: welcome-app
  • Image: lovelearnlinux/webserver:v1
  • Label: app=welcome
  • QoS: Burstable
  • Mount ConfigMap to /var/www/html
Service: welcome-app-svc
  • Type: ClusterIP
  • Port: 80
Update Task: Update the ConfigMap to change:
<h1>welcome to our test environment</h1>
to:
<h1>welcome to our best environment</h1>
Verify the changes are reflected in the application.Skills Tested:
  • ConfigMap creation from file/data
  • Volume mounting of ConfigMaps
  • ConfigMap updates
  • Application configuration management
ConfigMap updates can take time to propagate to mounted volumes (typically 60-90 seconds). Be patient when verifying changes.

Task 9: Affinity & Anti-Affinity

Objective:Practice pod affinity and anti-affinity for co-location and separation.
1

Deploy webapp

Pod name: webapp
  • Image: nginx:latest
  • Label: name=webapp
2

Deploy dbapp with affinity

Pod name: dbapp (deploy on the same node as webapp)
  • Image: redis
  • Label: name=dbapp
  • Use pod affinity with topologyKey: kubernetes.io/hostname
3

Redeploy with anti-affinity

Delete dbapp and redeploy it on a different node than webapp using pod anti-affinity
Skills Tested:
  • Pod affinity configuration
  • Pod anti-affinity configuration
  • Topology keys
  • Scheduling constraints
Use requiredDuringSchedulingIgnoredDuringExecution for strict affinity/anti-affinity rules. Check pod placement with kubectl get pods -o wide.

Task 10: RBAC & Service Account

Objective:Create complete RBAC configuration with ServiceAccount, Role, and RoleBinding.Namespace: nsone
1

Create ServiceAccount

ServiceAccount name: nsone-sa
2

Create Role

Grant permissions to create, get, and list:
  • Pods
  • ConfigMaps
Scope: nsone namespace only
3

Create RoleBinding

Bind the role to nsone-sa
4

Create test pod

Create a pod in nsone using ServiceAccount nsone-sa
5

Verify permissions

Test permissions using:
kubectl auth can-i create pods --as=system:serviceaccount:nsone:nsone-sa -n nsone
kubectl auth can-i delete pods --as=system:serviceaccount:nsone:nsone-sa -n nsone
kubectl auth can-i list configmaps --as=system:serviceaccount:nsone:nsone-sa -n nsone
Expected Results:
  • create pods: yes
  • delete pods: no
  • list configmaps: yes
Skills Tested:
  • ServiceAccount creation
  • Role definition with specific verbs
  • RoleBinding configuration
  • Permission testing with auth can-i
RBAC is namespace-scoped when using Role and RoleBinding. For cluster-wide permissions, use ClusterRole and ClusterRoleBinding.

Practice Tips

1

Time management

Allocate 8-10 minutes per task. Move on if you get stuck.
2

Verify everything

After each task, verify resources are created and functioning:
  • kubectl get for resource existence
  • kubectl describe for detailed status
  • kubectl logs for pod issues
3

Use imperative commands

Generate YAML with --dry-run=client -o yaml and edit as needed rather than writing from scratch.
4

Clean up between tasks

Delete resources from previous tasks to avoid confusion and resource conflicts.
5

Document your approach

Keep notes on commands that work. Build your personal cheat sheet.
After completing all tasks, review any mistakes and understand the correct solutions. Repetition builds speed and confidence.

Build docs developers (and LLMs) love