Posts

CKA-2025-MOCK-07 REQUEST AND LIMIT

Part-1   Create a Deployment named memory-demo in the default namespace with the following specifications: It must create 4 replicas (pods). Each pod must have: A single container using the image nginx:alpine A fair enough memory and cpu request  to set limit should be  (exactly double the request) The pods must run successfully without hitting memory scheduling constraints . Part-2 A  Deployment named   memory-demo  in the  default  namespace with the following specifications: four pod should be running but few pod is not running  troubleshoot and fix the issue A fair enough  memory and cpu request  to set limit should be  (exactly  double  the request) fair overhead be there  you can scaledown and down deployment to 0 The pods must  run successfully without hitting memory scheduling constraints .

CKA-2025 MOCK Q-06 PRIORITY

 Generate a PriorityClass named urgent-priority for urgent workloads,  setting the value to 10 less than the highest current user-defined priority class value.  Patch the Deployment mysql-writer in the database namespace to use the urgent-priority class and verify a successful rollout.   Note – Pods from other Deployments in the database namespace should be evicted if resources Cruch kubectl create namespace database # redis-cache Deployment cat <<EOF | kubectl apply -f - apiVersion: apps/v1 kind: Deployment metadata:   name: redis-cache   namespace: database spec:   replicas: 2   selector:     matchLabels:       app: redis-cache   template:     metadata:       labels:         app: redis-cache     spec:       containers:       - name: redis         image: redis:7         resources: ...

CKA 2025 MOCK Q-05 HPA

5 Mock Questions on Horizontal Pod Autoscaler (HPA) 🔶 Question 1: Scale Based on Custom CPU Target and Scale-Up Cooldown You have a Deployment named api-backend in the default namespace. Task: Create an HPA targeting 70% CPU usage Min: 1, Max: 10 replicas Set scale-up cooldown (delay before scaling up again) to 30 seconds File name: hpa-backend.yaml Bonus: Set the HPA to avoid scaling up rapidly even if CPU spikes.   cat <<EOF | kubectl apply -f - apiVersion: apps/v1 kind: Deployment metadata:   name: api-backend   namespace: default spec:   replicas: 2   selector:     matchLabels:       app: api-backend   template:     metadata:       labels:         app: api-backend     spec:       containers:   ...

MOCK HPA

 ðŸ”¶ Question 1: Scale Based on Custom CPU Target and Scale-Up Cooldown You have a Deployment named api-backend in the default namespace. Task: Create an HPA targeting 70% CPU usage Min: 1, Max: 3 replicas Set scale-up cooldown (delay before scaling up again) to 30 seconds File name: hpa-backend.yaml 📌 Bonus: Set the HPA to avoid scaling up rapidly even if CPU spikes. 🔶 Question 2: Memory-Based Autoscaling You have a Deployment memory-consumer running in apps namespace. Task: Create an HPA that: Scales based on Memory usage Uses autoscaling/v2 Min: 2, Max: 8 Target Memory usage: 500Mi average per pod File: hpa-memory.yaml 🧠 Hint: Use resource metric type with memory selector. This only works if metrics-server supports memory usage (sometimes mocked in exam). 🔶 Question 3: Stabilization Window for Both Scale-Up and Scale-Down Deployment load-burst-app is deployed in dev namespace. Task: Create an HPA that: Targets CPU usage at 60% Min: 3, Max: 12 Scale-Up window: 45 seconds Scale...
  In the exam, you need to maintain a rhythmic speed —that means working fast without wasting steps . You’ll have to use shortcuts smartly and avoid repeating the same command unnecessarily . These next 5 minutes could make a huge difference in your exam, so let’s begin. Many people recommend using imperative commands in Kubernetes — like kubectl run or kubectl expose . While these can be useful for quickly creating a Pod , I personally recommend: Use imperative only for Pod creation , but for everything else — avoid it. Why? Because in the real world and exams, what really helps is: Knowing how to find the correct YAML Editing and understanding it properly Applying declarative files using kubectl apply -f So instead of relying on imperative commands, get comfortable with : The official Kubernetes documentation Using Ctrl + F + apiVersion to jump straight to YAML examples The Kubernetes cheat sheet (we’ll cover that too) Mastering how to quickly locate o...

CKA 2025 MOCK Q-04 HELM

  Variation 2 Outline the Helm CLI steps to:           https://argoproj.github.io/argo-helm Add and update the Argo Helm repo Install Argo CD v8.0.17 with CRDs enabled in argocd Install Argo CD v8.0.17 with CRDs disabled in argocd-no-crds Render both releases to argo-cd-crds-enabled.yaml and argo-cd-crds-disabled.yaml

CKA 2025 MOCK Q-02 Side Car Conatiner

  🔶 Mock Question: Add a Sidecar Container for Log Tailing Task You have a Deployment named myapp in the default namespace. This Deployment has a single container named myapp which writes log messages to a file at /opt/logs.txt every second. Currently, there is no mechanism to tail or view this log in real-time. Your Task : Add a sidecar container to the existing Deployment named logshipper . This container must: Use the image alpine:latest Run the following command: tail -F /opt/logs.txt Both containers must share a volume at path /opt using an emptyDir volume named data . Do not delete or modify the original myapp container. Make sure the logshipper runs as a sidecar container , not as an initContainer .