KCNA Kubernetes Architecture & Components — Questions and Answers
Question 1: What is the primary function of the Kubernetes control plane?
- To run the applications.
- To manage the overall state of the cluster (Correct answer)
- To store the application data.
- To handle networking between containers.
Correct answer: To manage the overall state of the cluster
The Kubernetes control plane acts as the brain of the cluster, making global decisions about scheduling, detecting and responding to cluster events, and maintaining the desired state. It ensures that the cluster operates as intended by continuously reconciling the actual state with the desired state defined by users.
Question 2: Which component in Kubernetes is responsible for scheduling the pods?
- Kubelet.
- Scheduler (Correct answer)
- Controller Manager.
- Kube-proxy.
Correct answer: Scheduler
The Kubernetes Scheduler is a control plane component that watches for newly created Pods with no assigned node. It then selects an optimal node for each Pod to run on, considering factors like resource requirements, hardware constraints, affinity/anti-affinity specifications, and node taints/tolerations.
Question 3: What is the role of the Kubelet in Kubernetes?
- To schedule pods on nodes.
- To manage persistent storage.
- To ensure containers are running (Correct answer)
- To configure network policies.
Correct answer: To ensure containers are running
The Kubelet is an agent that runs on each worker node in a Kubernetes cluster. Its primary role is to ensure that containers within Pods are running and healthy, communicating with the control plane to receive Pod specifications and managing the lifecycle of containers on its node.
Question 4: Which component stores the cluster's state in Kubernetes?
- Scheduler.
- etcd (Correct answer)
- Controller Manager.
- Kube-proxy.
Correct answer: etcd
etcd is a highly available key-value store that serves as Kubernetes' backing store for all cluster data. It stores the entire configuration and state of the Kubernetes cluster, including information about Pods, Services, Deployments, and other resources, making it a critical component for cluster operation.
Question 5: What is the purpose of Kubernetes namespaces?
- To isolate applications.
- To organize and group resources (Correct answer)
- To store application data.
- To manage containers.
Correct answer: To organize and group resources
Kubernetes namespaces provide a mechanism for isolating groups of resources within a single cluster. They are used to divide cluster resources among multiple users or teams, allowing for logical separation and preventing naming collisions, which is crucial for managing complex environments.
Question 6: What is the function of Kubernetes pods?
- To manage clusters.
- To contain one or more containers (Correct answer)
- To provide network policies.
- To manage persistent storage.
Correct answer: To contain one or more containers
A Kubernetes Pod is the smallest deployable unit in Kubernetes, representing a single instance of a running process in a cluster. It encapsulates one or more containers, along with shared storage, network resources, and a specification for how to run the containers.
Question 7: What is the function of Kube-proxy in Kubernetes?
- To schedule pods on nodes.
- To manage the cluster state.
- To maintain network rules (Correct answer)
- To manage container storage.
Correct answer: To maintain network rules
Kube-proxy runs on each node and maintains network rules on the host, allowing network communication to your Pods from inside or outside of the cluster. It handles network proxying for Kubernetes Services, ensuring that traffic is correctly routed to the appropriate Pods.
Question 8: Which component monitors and controls the state of the Kubernetes nodes?
- Scheduler.
- Controller Manager (Correct answer)
- Kubelet.
- etcd.
Correct answer: Controller Manager
The Controller Manager runs various controller processes that regulate the state of the cluster. It monitors the shared state of the cluster through the API server and makes changes attempting to move the current state towards the desired state, including managing node health and replication controllers.
Question 9: What is a Kubernetes Deployment?
- A method for scaling applications.
- A set of services.
- A mechanism for updating pods (Correct answer)
- A container storage solution.
Correct answer: A mechanism for updating pods
A Kubernetes Deployment provides declarative updates for Pods and ReplicaSets. It allows you to describe the desired state for your application's Pods, and the Deployment Controller then ensures that the actual state matches the desired state, handling updates, rollbacks, and scaling.
What is the primary function of the Kubernetes control plane?