CKA Cluster Architecture, Installation, and Configuration 1 — Questions and Answers
Question 1: What is the role of the kube-apiserver in a Kubernetes cluster?
- It schedules workloads onto nodes.
- It provides an interface for the control plane to communicate with the cluster. (Correct answer)
- It stores the cluster's state in a key-value database.
- It runs the containers on the nodes.
Correct answer: It provides an interface for the control plane to communicate with the cluster.
The kube-apiserver is the front end of the Kubernetes control plane, exposing the Kubernetes API. It acts as the central communication hub, processing REST requests, validating configurations, and enabling all components of the control plane and users to interact with the cluster's resources.
Question 2: Which command initializes a Kubernetes control plane node using kubeadm?
- kubeadm init (Correct answer)
- kubeadm config
- kubeadm join
- kubectl create
Correct answer: kubeadm init
The `kubeadm init` command is specifically designed to bootstrap a Kubernetes control-plane node. It performs the necessary steps to set up the core components, configure the cluster, and generate the required certificates and configuration files, effectively turning a machine into a Kubernetes control plane.
Question 3: Which component of a Kubernetes cluster stores the configuration data in a key-value store?
- kube-proxy
- kube-scheduler
- etcd (Correct answer)
- kubelet
Correct answer: etcd
etcd is a distributed, reliable key-value store that Kubernetes uses to store all cluster data, including configuration, state, and metadata. It acts as the cluster's single source of truth, ensuring consistency and availability of the control plane's critical information. Without etcd, the Kubernetes API server would not be able to retrieve or persist the desired state of the cluster.
Question 4: What command is used to apply a Pod network in a Kubernetes cluster after initialization?
- kubectl create network
- kubeadm network apply
- kubectl apply -f <network-yaml-file> (Correct answer)
- kubeadm init --network
Correct answer: kubectl apply -f <network-yaml-file>
After `kubeadm init` initializes the control plane, a Container Network Interface (CNI) plugin must be installed to enable Pod-to-Pod communication. CNI plugins are typically deployed using a YAML manifest, which is applied to the cluster using the `kubectl apply -f` command. This command reads the configuration from the specified YAML file and creates the necessary Kubernetes objects, such as DaemonSets or Deployments, to install the network plugin.
Question 5: What is the purpose of a kube-scheduler in Kubernetes?
- To ensure high availability of the control plane.
- To allocate resources for Pods across the cluster. (Correct answer)
- To monitor the health of nodes and workloads.
- To load balance traffic between Pods.
Correct answer: To allocate resources for Pods across the cluster.
The `kube-scheduler` is a control plane component responsible for watching newly created Pods that have no assigned node. It selects the best node for each Pod to run on, considering various factors like resource requirements, hardware constraints, policy constraints, and affinity/anti-affinity specifications. Its primary goal is to ensure efficient resource utilization and optimal placement of workloads across the cluster.
What is the role of the kube-apiserver in a Kubernetes cluster?