nerdexam
Linux_FoundationLinux_Foundation

CKS · Question #34

CKS Question #34: Real Exam Question with Answer & Explanation

This simulation question tests your ability to switch Kubernetes cluster contexts using kubectl and operate within the correct cluster environment before performing administrative tasks. The candidate must set the active context to 'dev' before any subsequent kubectl commands app

Submitted by obi.ng· May 5, 2026Cluster Hardening

Question

SIMULATION Cluster: dev Master node: master1 Worker node: worker1 You can switch the cluster/configuration context using the following command: [desk@cli] $ kubectl config use-context dev

Explanation

This simulation question tests your ability to switch Kubernetes cluster contexts using kubectl and operate within the correct cluster environment before performing administrative tasks. The candidate must set the active context to 'dev' before any subsequent kubectl commands apply to the intended cluster.

Approach. The correct first step is always to run kubectl config use-context dev to ensure all subsequent kubectl commands target the correct cluster - in this case 'dev' with master node 'master1' and worker node 'worker1'. Forgetting to switch context is one of the most common mistakes in CKA/CKAD exams and causes commands to silently run against the wrong cluster. After switching, verify with kubectl config current-context and optionally kubectl get nodes to confirm the expected nodes (master1, worker1) are visible. Every simulation task in the exam begins with this context-switch step, and performing the task in the wrong context earns zero marks even if the work itself is correct.

Concept tested. Kubernetes multi-cluster context management using kubeconfig - specifically the use of kubectl config use-context to select the active cluster before performing operations. This maps to understanding kubeconfig structure (clusters, users, contexts) and is a foundational skill tested on the CKA exam.

Reference. Kubernetes Official Docs - Configure Access to Multiple Clusters: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

Topics

#kubectl#kubeconfig#context management#cluster access

Community Discussion

No community discussion yet for this question.

Full CKS PracticeBrowse All CKS Questions