WebMagicInformatica
CKA practice questions

CKA practice questions: Cluster Architecture, Installation and Configuration

5 free questions on Cluster Architecture, Installation and Configuration, 25% of the Kubernetes: CKA exam. Try each one, then open the answer and explanation. None of them are in the free readiness check, so you can still take it fresh.

Question 1

After etcdutl snapshot restore /backup/etcd.db --data-dir /var/lib/etcd-restore, what must you do on a kubeadm control plane node so the cluster uses the restored data?

  1. A.

    Run kubectl apply -f /backup/etcd.db against the API server.

  2. B.

    Change only the --data-dir flag in the etcd manifest and leave the etcd-data hostPath volume unchanged.

  3. C.

    Run kubeadm reset followed by kubeadm init --etcd-snapshot=/backup/etcd.db.

  4. D.

    Edit /etc/kubernetes/manifests/etcd.yaml so the etcd-data hostPath volume points to /var/lib/etcd-restore; the kubelet then recreates the static Pod.

Show answer and explanation

Answer: D

etcd runs as a static Pod. The restored directory must be mounted into it, so change the hostPath of the data volume (and keep the container's --data-dir consistent with the mounted path). The kubelet notices the manifest change and restarts etcd.

  • A snapshot is not a Kubernetes manifest.
  • Only changing the flag leaves the new directory unmounted in the container.
  • kubeadm init has no --etcd-snapshot option, and reset would wipe the node.
Question 2

The control plane of a kubeadm cluster has already been upgraded to the next minor version, and the worker node worker2 is still on the old one. Which sequence correctly upgrades the worker with kubeadm?

  1. A.

    Run kubeadm upgrade apply on the worker, upgrade kubelet, drain the node, then uncordon it.

  2. B.

    Upgrade the kubeadm package on the node, run kubeadm upgrade node, drain the node, upgrade kubelet and kubectl and restart kubelet, then uncordon the node.

  3. C.

    Upgrade kubelet and restart it, run kubeadm upgrade node, upgrade kubeadm, then drain and uncordon.

  4. D.

    Uncordon the node, upgrade kubelet, run kubeadm upgrade node, then drain it.

Show answer and explanation

Answer: B

For worker nodes the documented order is: upgrade kubeadm, kubeadm upgrade node, drain, upgrade kubelet/kubectl and restart the kubelet, uncordon.

  • kubeadm upgrade apply is only for the first control plane node.
  • The kubelet must not be upgraded before kubeadm.
  • Uncordoning before the upgrade, or draining last, defeats the purpose of draining.
Question 3

A ClusterRole named edit-apps (allows managing Deployments) is bound to the group team-a using a RoleBinding in the namespace team-a. What access do members of the group have?

  1. A.

    They can manage Deployments only in the team-a namespace.

  2. B.

    They can manage Deployments in every namespace.

  3. C.

    They get no access, because a RoleBinding cannot reference a ClusterRole.

  4. D.

    They can manage all resource types in team-a, because ClusterRoles ignore the rule list when bound by a RoleBinding.

Show answer and explanation

Answer: A

A RoleBinding may reference a ClusterRole; the permissions then apply only inside the RoleBinding's namespace. This is a common way to reuse one rule set per namespace.

  • Cluster-wide access would need a ClusterRoleBinding.
  • The reference is valid.
  • The rule list is always honoured.
Question 4

A PostgreSQL operator is installed and you create an object of kind: PostgresCluster. Which component is responsible for creating the StatefulSet and Pods the cluster needs?

  1. A.

    The operator's controller, which watches PostgresCluster objects and reconciles the required resources.

  2. B.

    The kube-apiserver, as soon as the custom resource is stored.

  3. C.

    The CustomResourceDefinition itself.

  4. D.

    The kubelet on the node that stores the resource.

Show answer and explanation

Answer: A

A CRD only defines the new API type. An operator is a controller that watches those custom resources and performs the operational work to match the desired state.

  • The API server stores objects, it does not act on them.
  • A CRD is a schema without logic.
  • The kubelet manages Pods on its node.
Question 5

A new worker must join an existing kubeadm cluster, but the original bootstrap token has expired. Which command, run on a control plane node, prints a fresh complete join command?

  1. A.

    kubeadm token create --print-join-command

  2. B.

    kubeadm join --generate-token

  3. C.

    kubectl get token --print-join-command

  4. D.

    kubeadm init phase bootstrap-token --list

Show answer and explanation

Answer: A

kubeadm token create --print-join-command creates a new token (valid 24 hours by default) and prints the full kubeadm join command including the CA cert hash.

  • The other commands are not valid or do not create a token.

How ready are you for CKA?

Take the free readiness check: 15 questions from every exam domain in 20 minutes, with your score per domain.

  • 20 minutes
  • 15 questions
  • Free with an account

More CKA practice by topic

Back to the CKA practice test →

Independent practice material written from the official exam guide. Not affiliated with or endorsed by the exam provider.