KCNA · Domain 1: Kubernetes Fundamentals · 44% of the exam
Task 1.1: Kubernetes Core Concepts
The control plane and the node components, the API and its objects, desired state and controllers, namespaces, labels and selectors, and the workload resources: Pods, ReplicaSets, Deployments, StatefulSets, DaemonSets, Jobs and CronJobs.
Study it
Control plane and nodes: the API server, etcd, scheduler, controllers, kubelet and kube-proxy
Try each one before opening the answer. Every option is explained, with the CNCF documentation page that proves it.
Question 1 · choose 1
A platform team is writing its disaster recovery plan. Which component holds the data for every object the API serves, so that losing it without a backup means losing the cluster's recorded state?
Akube-apiserver
Bkube-controller-manager
CThe etcd cluster
DThe kubelet
Show the answer and why
Akube-apiserver
Incorrect
The API server exposes the Kubernetes HTTP API and validates requests; it keeps no data of its own.
Bkube-controller-manager
Incorrect
It runs the controllers that act on objects. It reads and writes through the API and keeps no store of its own to back up.
CThe etcd cluster
Correct
etcd is the consistent, highly available key-value store that keeps all API server data. Back it up and you can restore the cluster's objects.
DThe kubelet
Incorrect
The kubelet is the agent on each node that makes sure the Pods assigned to it are running. It holds node-local state only.
Every Kubernetes object is persisted in etcd. The other control plane components and the node agents work through the API, so the etcd data is what a backup of the cluster's state has to capture.
A Deployment runs with replicas set to 3. A developer deletes one of its Pods by name, and a few seconds later a new Pod with a different name is running. What brought the count back to three?
AA controller saw 2 Pods against the desired 3 and created another
BThe kubelet restarted the deleted Pod on the same node from its local copy
Ckube-proxy recreated the Pod so the Service would keep three endpoints
DThe API server rolled the delete back because the Pod belonged to a Deployment
Show the answer and why
AA controller saw 2 Pods against the desired 3 and created another
Correct
The ReplicaSet behind the Deployment runs a control loop that drives the observed state toward the declared replica count, so it creates a replacement Pod.
BThe kubelet restarted the deleted Pod on the same node from its local copy
Incorrect
The kubelet restarts containers of Pods that still exist. A deleted Pod is gone; the replacement is a new object with a new name.
Ckube-proxy recreated the Pod so the Service would keep three endpoints
Incorrect
kube-proxy maintains network rules for Services on each node. It never creates Pods.
DThe API server rolled the delete back because the Pod belonged to a Deployment
Incorrect
The delete succeeded, which is why the new Pod has a different name. Nothing reverses an accepted request.
Kubernetes works by reconciliation: a controller watches the shared state through the API and makes changes until the current state matches the desired state. Here the ReplicaSet controller noticed one Pod too few.
A team must run exactly one log-collection agent Pod on each node of the cluster, including nodes that the autoscaler adds later. Which workload resource fits this requirement?
ADaemonSet
BDeployment with one replica per node
CStatefulSet
DJob with parallelism equal to the node count
Show the answer and why
ADaemonSet
Correct
A DaemonSet makes all (or selected) nodes run a copy of a Pod and adds the Pod to new nodes as they join. Log collectors are a textbook use.
BDeployment with one replica per node
Incorrect
A Deployment keeps a replica count, not one Pod per node. Two replicas can land on the same node, and a new node gets nothing.
CStatefulSet
Incorrect
A StatefulSet runs a counted set of replicas; it does not follow the node list.
DJob with parallelism equal to the node count
Incorrect
A Job runs Pods to completion. An agent that must keep running on every node is not batch work.
Per-node daemons such as log collectors, node monitoring agents and storage daemons are what DaemonSets are for: the controller follows the node list rather than a replica count.
A Pod has two containers: an application that listens on TCP port 8080 and a proxy container that must forward requests to that application and to no other copy of it. Which address should the proxy use?
AThe Service's ClusterIP on port 8080
BThe application container's own IP on port 8080
CThe node's IP address on port 8080
Dlocalhost:8080, from inside the Pod
Show the answer and why
AThe Service's ClusterIP on port 8080
Incorrect
A Service load-balances across every ready Pod it selects, so the request could reach a copy in another Pod.
BThe application container's own IP on port 8080
Incorrect
Containers in a Pod do not get their own addresses; they share the Pod's IP address and port space.
CThe node's IP address on port 8080
Incorrect
That only works with a hostPort or host networking, and it would reach whatever listens on that node, not specifically this Pod.
Dlocalhost:8080, from inside the Pod
Correct
Containers in the same Pod share one network namespace, so the proxy reaches the application on the loopback interface.
A Pod is a group of containers that share network and storage context. Every container in it shares the Pod's IP address and ports and can talk to the others over localhost.
A team wants each Deployment to carry the Git commit it was built from and the on-call contact for the service. Release tools will read these values, but nothing will ever select objects by them. Where should they be recorded?
AIn labels under metadata
BIn annotations under metadata
CIn a ConfigMap mounted into the Deployment's Pods
DIn the Deployment's spec.selector
Show the answer and why
AIn labels under metadata
Incorrect
Labels are meant for identifying and selecting objects, and their values are short and restricted in format. Data nobody selects on belongs elsewhere.
BIn annotations under metadata
Correct
Annotations hold arbitrary, non-identifying metadata for tools and people, and their values may be long or structured.
CIn a ConfigMap mounted into the Deployment's Pods
Incorrect
A ConfigMap carries configuration for the application inside the containers. It does not describe the Deployment object to tools.
DIn the Deployment's spec.selector
Incorrect
The selector decides which Pods the Deployment manages and cannot be changed after creation for apps/v1. It is not a place for notes.
Use labels for attributes you query and select by, and annotations for descriptive metadata such as build information, contacts or tool settings.
A user has full rights inside the namespace team-a and none at cluster level. Creating one object fails because its kind is cluster-scoped and does not live in any namespace. Which kind was it?
APersistentVolumeClaim
BRole
CNetworkPolicy
DStorageClass
Show the answer and why
APersistentVolumeClaim
Incorrect
A claim is created in a namespace and is the namespaced request for storage.
BRole
Incorrect
A Role grants permissions within one namespace and is itself namespaced; its cluster-wide counterpart is ClusterRole.
CNetworkPolicy
Incorrect
A NetworkPolicy is namespaced and applies to Pods in its own namespace.
DStorageClass
Correct
StorageClass is a cluster-wide object, like Nodes and PersistentVolumes, so namespace permissions do not cover it.
Namespace scoping applies only to namespaced kinds such as Deployments, Services and claims. Cluster-wide kinds such as StorageClass, Node and PersistentVolume need cluster-level permission.
Before each release a team runs a database schema migration. It must run once, be retried if its Pod fails, and then stop for good when it succeeds. Which resource should run it?
ADeployment with replicas set to 1
BA CronJob scheduled before each release window
CA Job created for each release
DA DaemonSet with a single-node selector
Show the answer and why
ADeployment with replicas set to 1
Incorrect
A Deployment keeps its Pods running and restarts them after they exit, so a finished migration would run again and again.
BA CronJob scheduled before each release window
Incorrect
A CronJob starts Jobs on a repeating schedule. A migration tied to each release is not time-based.
CA Job created for each release
Correct
A Job creates Pods until the requested number complete successfully, retries failures, and then stops.
DA DaemonSet with a single-node selector
Incorrect
A DaemonSet runs a long-lived Pod per node, which would start the migration once on every node.
Run-to-completion work is a Job. CronJobs add a schedule on top of Jobs; Deployments and DaemonSets are for work that keeps running.
A company moves to a managed Kubernetes service where the provider runs the control plane and the company operates only the worker nodes. Which two components does the provider run as part of the control plane? (Choose TWO.)
Akube-scheduler
Bkubelet
Ckube-controller-manager
Dkube-proxy
EThe container runtime
Show the answer and why
Akube-scheduler
Correct
The scheduler is a control plane component that assigns new Pods to nodes.
Bkubelet
Incorrect
The kubelet is a node component; it runs on every worker node to start and watch that node's Pods.
Ckube-controller-manager
Correct
The controller manager is a control plane component that runs the built-in controllers.
Dkube-proxy
Incorrect
kube-proxy is an optional node component, not part of the control plane.
EThe container runtime
Incorrect
The runtime runs containers on each node and is part of the node components.
The control plane is kube-apiserver, etcd, kube-scheduler, kube-controller-manager and the optional cloud-controller-manager. The kubelet, kube-proxy and the container runtime run on the nodes.
An incident review finds two log entries for a Pod named web-0, one from before and one from after the Pod was deleted and created again with the same name. Which field tells the two objects apart?
Ametadata.name
Bmetadata.uid
Cmetadata.namespace
Dmetadata.labels
Show the answer and why
Ametadata.name
Incorrect
The name was reused, so it is the same for both objects.
Bmetadata.uid
Correct
Every object created over the lifetime of a cluster gets a distinct UID, which separates historical occurrences of similar objects.
Cmetadata.namespace
Incorrect
Both objects lived in the same namespace.
Dmetadata.labels
Incorrect
Labels are copied from the same template and can be identical.
Names can be reused after deletion; the UID is unique for the whole life of the cluster.
A company wants a label key that records the owning cost center on every object, and it must never clash with keys used by Kubernetes itself. Which key follows the labeling rules?
Akubernetes.io/cost-center
Bk8s.io/cost-center
Cfinance.example.com/cost-center
Dcost center, with a space
Show the answer and why
Akubernetes.io/cost-center
Incorrect
The kubernetes.io/ prefix is reserved for Kubernetes core components.
Bk8s.io/cost-center
Incorrect
The k8s.io/ prefix is reserved as well.
Cfinance.example.com/cost-center
Correct
A prefix based on a DNS subdomain you control keeps the key yours; kubernetes.io/ and k8s.io/ are reserved for core components.
Dcost center, with a space
Incorrect
Spaces are not allowed in label keys.
Label keys can carry a DNS-style prefix; use your own domain and leave the Kubernetes prefixes to Kubernetes.
A CronJob has schedule set to "0 2 * * *". When does it create Jobs?
AEvery day at 02:00, in the controller manager's time zone
BEvery two hours, on the hour, starting at 02:00
CAt 00:02 on the first day of each month
DAt 02:00 on Sundays, once a week
Show the answer and why
AEvery day at 02:00, in the controller manager's time zone
Correct
The fields are minute, hour, day of month, month and day of week, so minute 0 of hour 2, each day; without spec.timeZone, kube-controller-manager uses its local time zone.
BEvery two hours, on the hour, starting at 02:00
Incorrect
That would need a step value in the hour field, such as */2.
CAt 00:02 on the first day of each month
Incorrect
The first field is the minute and the second the hour, not the other way round.
DAt 02:00 on Sundays, once a week
Incorrect
A day of week of 0 would have to be in the fifth field.
CronJob schedules use the five-field cron format: minute, hour, day of month, month, day of week.