☸️

Kubernetes MCQ

Test your Kubernetes knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.

100 Questions 40 Beginner 40 Intermediate 20 Advanced

How This Practice Test Works

Every question below expands right on this page — click a question to reveal its four options, pick the one you think is correct, and you'll get instant feedback along with the correct answer and a short explanation of the reasoning. Questions are grouped by difficulty, so start with the 40 beginner questions to confirm your fundamentals, work through the 40 intermediate ones, and finish with the 20 advanced questions that mirror what exams and technical screenings actually ask. There's no sign-up, no timer, and no limit — retake the test as often as you like.

Curated by Tech Baithak Editorial Team  ·  Last updated: June 2026

1

What is Kubernetes?

B

Correct Answer

An open-source platform for automating deployment, scaling, and management of containerized applications

Explanation

Kubernetes (often abbreviated K8s) is a container orchestration platform that automates deploying, scaling, and managing containerized applications across clusters of machines.

2

What is the smallest deployable unit in Kubernetes?

B

Correct Answer

A Pod

Explanation

A Pod is the smallest deployable unit in Kubernetes, representing one or more tightly coupled containers that share network and storage resources.

3

What is a Kubernetes Node?

B

Correct Answer

A worker machine (physical or virtual) in a Kubernetes cluster that runs Pods

Explanation

A Node is a machine (VM or physical) that is part of the cluster and runs Pods, managed by the control plane.

4

What is the role of the Kubernetes "control plane"?

B

Correct Answer

It manages the overall state of the cluster, making global decisions like scheduling and responding to cluster events

Explanation

The control plane (including components like the API server, scheduler, and controller manager) maintains the desired state of the cluster and makes decisions about scheduling and scaling.

5

What command-line tool is commonly used to interact with a Kubernetes cluster?

B

Correct Answer

kubectl

Explanation

"kubectl" is the primary command-line tool for communicating with a Kubernetes cluster's API server to create, inspect, and manage resources.

6

What does the command "kubectl get pods" do?

B

Correct Answer

Lists the pods running in the current namespace

Explanation

"kubectl get pods" lists pods in the current namespace, showing their name, status, restarts, and age.

7

What is a Kubernetes "Deployment" primarily used for?

A

Correct Answer

To declaratively manage a set of replica Pods, handling updates and rollbacks

Explanation

A Deployment manages a ReplicaSet of Pods, providing declarative updates, rolling updates, and rollback capabilities for stateless applications.

8

What is a Kubernetes "Service"?

B

Correct Answer

An abstraction that defines a logical set of Pods and a policy for accessing them, providing a stable network endpoint

Explanation

A Service provides a stable IP address and DNS name to access a set of Pods, even as individual Pods are created and destroyed.

9

What does "kubectl apply -f deployment.yaml" do?

B

Correct Answer

Creates or updates resources in the cluster to match the configuration defined in the YAML file

Explanation

"kubectl apply" applies a configuration to a resource, creating it if it doesn't exist or updating it to match the desired state declared in the file.

10

What is a "Namespace" in Kubernetes used for?

B

Correct Answer

To provide a mechanism for isolating groups of resources within a single cluster, useful for multi-tenant environments

Explanation

Namespaces divide cluster resources between multiple users or teams, providing a scope for names and helping organize resources.

11

What is the purpose of a "ReplicaSet"?

A

Correct Answer

To ensure a specified number of identical Pod replicas are running at any given time

Explanation

A ReplicaSet maintains a stable set of replica Pods running at any given time, replacing Pods that fail or are deleted. Deployments manage ReplicaSets to enable rolling updates.

12

What does "kubectl describe pod <pod-name>" provide?

B

Correct Answer

Detailed information about a pod, including its status, events, container details, and configuration

Explanation

"kubectl describe" provides detailed human-readable information about a resource, including recent events, useful for debugging issues like failed scheduling or crashes.

13

What is a "ConfigMap" used for in Kubernetes?

B

Correct Answer

To store non-confidential configuration data as key-value pairs, which can be consumed by Pods as environment variables or files

Explanation

ConfigMaps decouple configuration data from container images, allowing the same image to be used with different configurations across environments.

14

What is a "Secret" in Kubernetes?

A

Correct Answer

An object used to store and manage sensitive information, such as passwords, OAuth tokens, and SSH keys

Explanation

Secrets store sensitive data separately from application code/images; by default they are base64-encoded (not encrypted at rest unless additional measures are configured).

15

What does the term "kubectl logs <pod-name>" do?

B

Correct Answer

Retrieves the logs from a container within the specified pod

Explanation

"kubectl logs" fetches the stdout/stderr output of a container in a pod, useful for debugging application issues.

16

What is the purpose of a "Label" in Kubernetes?

A

Correct Answer

Key-value pairs attached to objects (like Pods) used to organize and select subsets of objects

Explanation

Labels are arbitrary key-value pairs used by selectors (in Services, Deployments, etc.) to identify and group related objects.

17

What does "kubectl scale deployment <name> --replicas=5" do?

B

Correct Answer

Changes the desired number of Pod replicas managed by the deployment to 5

Explanation

"kubectl scale" updates the replica count of a Deployment (or ReplicaSet/StatefulSet), and the controller adjusts the number of running Pods to match.

18

What is "etcd" in the context of Kubernetes?

B

Correct Answer

A consistent, distributed key-value store used by Kubernetes to store all cluster data and state

Explanation

etcd is the backing store for all cluster configuration data, representing the overall state of the cluster at any given time.

19

What is the purpose of the "kube-scheduler"?

B

Correct Answer

To watch for newly created Pods with no assigned node and select a suitable node for them to run on

Explanation

The scheduler assigns Pods to Nodes based on resource requirements, constraints, affinity rules, and other factors.

20

What does "kubectl create namespace dev" do?

A

Correct Answer

Creates a new namespace named "dev" for organizing resources

Explanation

"kubectl create namespace <name>" creates a new namespace, which can then be used to isolate resources for that environment or team.

21

What is a "container image" in the context of running workloads in Kubernetes?

B

Correct Answer

A packaged application with its dependencies, typically built with tools like Docker, that Kubernetes pulls and runs inside Pods

Explanation

Kubernetes runs containers based on OCI-compliant images (commonly built with Docker), specified in a Pod's container spec via the "image" field.

22

What does "kubectl delete pod <pod-name>" do if the pod is managed by a Deployment?

B

Correct Answer

Deletes the specified pod, but the Deployment's controller will create a new pod to maintain the desired replica count

Explanation

Since the Deployment continuously reconciles towards the desired replica count, deleting a managed pod causes the ReplicaSet controller to create a replacement pod automatically.

23

What is the difference between a "Pod" and a "container"?

B

Correct Answer

A Pod is a Kubernetes abstraction that can contain one or more containers, which share networking and storage within that Pod

Explanation

A Pod wraps one or more containers (often one main container plus optional sidecars) that share the same network namespace and can share storage volumes.

24

What does "kubectl get nodes" display?

B

Correct Answer

A list of worker machines (nodes) in the cluster along with their status

Explanation

"kubectl get nodes" shows the nodes that make up the cluster, including their status (Ready/NotReady), roles, age, and Kubernetes version.

25

What is the role of "kubelet" running on each node?

B

Correct Answer

It is an agent that ensures containers described in PodSpecs are running and healthy on that node

Explanation

The kubelet runs on every node and works with the container runtime to start, stop, and monitor containers as specified by PodSpecs assigned to that node.

26

What is a "YAML manifest" in Kubernetes?

B

Correct Answer

A human-readable text file (in YAML format) that declaratively describes the desired state of a Kubernetes resource

Explanation

Kubernetes resources are typically defined in YAML (or JSON) manifests specifying "apiVersion", "kind", "metadata", and "spec" fields describing the desired state.

27

What does the "kind" field in a Kubernetes manifest specify?

B

Correct Answer

The type of resource being defined, such as Pod, Service, Deployment, or ConfigMap

Explanation

"kind" identifies the resource type (e.g. "Pod", "Deployment", "Service") that the manifest describes.

28

What is the purpose of "kubectl port-forward"?

B

Correct Answer

To forward a local port on your machine to a port on a pod, useful for debugging or accessing a service without exposing it externally

Explanation

"kubectl port-forward <pod> <local-port>:<pod-port>" creates a temporary tunnel from your local machine to a pod, commonly used for local debugging.

29

What is a "Job" in Kubernetes used for?

B

Correct Answer

To run one or more Pods that execute a task to completion, such as a batch processing job

Explanation

A Job creates Pods that run until successful completion, unlike Deployments which keep Pods running continuously; useful for batch tasks like data migrations.

30

What is a "CronJob" in Kubernetes?

B

Correct Answer

A resource that creates Jobs on a repeating schedule, similar to a Unix cron job

Explanation

CronJobs run Jobs on a time-based schedule defined using cron syntax, useful for periodic tasks like backups or report generation.

31

What does the term "desired state" mean in Kubernetes?

B

Correct Answer

The configuration a user declares (e.g. via YAML) representing how the system should look, which Kubernetes continuously works to match against the actual state

Explanation

Kubernetes uses a declarative model: users specify the desired state, and controllers continuously reconcile the actual cluster state to match it.

32

What is the purpose of "kubectl exec -it <pod> -- /bin/bash"?

B

Correct Answer

To open an interactive bash shell inside a running container in the specified pod

Explanation

Similar to "docker exec", "kubectl exec -it" lets you run a command (often a shell) interactively inside a container of a running pod for debugging.

33

What is "Minikube" used for?

B

Correct Answer

A tool for running a single-node Kubernetes cluster locally for development and testing

Explanation

Minikube creates a local, single-node Kubernetes cluster (typically inside a VM or container) for development and learning purposes.

34

What does the "restartPolicy" field in a Pod spec control?

B

Correct Answer

Whether containers within the Pod should be restarted by the kubelet when they exit (Always, OnFailure, or Never)

Explanation

restartPolicy determines the kubelet's behavior when a container in the Pod terminates — "Always" (default for Deployments), "OnFailure", or "Never" (common for Jobs).

35

What is the difference between "kubectl create" and "kubectl apply"?

B

Correct Answer

"kubectl create" creates a new resource and fails if it already exists, while "kubectl apply" creates the resource if it doesn't exist or updates it to match the file if it does

Explanation

"create" is imperative and errors on existing resources, while "apply" is declarative, supporting both creation and incremental updates based on the desired configuration.

36

What does a "selector" do in a Kubernetes Service definition?

B

Correct Answer

It defines which Pods (based on matching labels) the Service routes traffic to

Explanation

A Service's selector matches Pods by their labels, determining which set of Pods receive traffic sent to that Service.

37

What is the purpose of "kubectl rollout status deployment/<name>"?

B

Correct Answer

To watch the status of a deployment's rollout until it completes

Explanation

"kubectl rollout status" streams the progress of an ongoing deployment rollout, useful for confirming when an update has finished successfully.

38

What does it mean for Kubernetes to be "cloud-agnostic"?

B

Correct Answer

Kubernetes can run on various infrastructures — on-premises, or across different cloud providers — without being tightly coupled to any single one

Explanation

Because Kubernetes abstracts infrastructure details behind APIs, the same application definitions can generally run on different clouds or on-premises with minimal changes.

39

What is the purpose of a "readiness probe"?

B

Correct Answer

To determine whether a container is ready to start accepting traffic, so the Service only routes requests to ready Pods

Explanation

A readiness probe signals whether a Pod is ready to serve traffic; if it fails, the Pod is removed from Service endpoints until it passes again.

40

What does the abbreviation "K8s" stand for?

B

Correct Answer

A numeronym for "Kubernetes", where "8" represents the eight letters between the "K" and the "s"

Explanation

"K8s" is a common numeronym shorthand for "Kubernetes", counting the eight letters ("ubernete") omitted between the first "K" and the last "s".

1

What is the difference between a "liveness probe" and a "readiness probe"?

B

Correct Answer

A liveness probe determines if a container should be restarted because it is unresponsive/deadlocked, while a readiness probe determines if a container is ready to receive traffic (without necessarily restarting it if it fails)

Explanation

Liveness probe failures cause the kubelet to restart the container; readiness probe failures simply remove the Pod from Service endpoints until it becomes ready again, without restarting it.

2

What is the purpose of a "PersistentVolume" (PV) and "PersistentVolumeClaim" (PVC)?

B

Correct Answer

A PV represents a piece of storage provisioned in the cluster (independent of any Pod's lifecycle), and a PVC is a request by a user for storage that binds to a matching PV, allowing Pods to use persistent storage

Explanation

PVs are cluster resources representing actual storage (e.g. a cloud disk), while PVCs are namespaced requests for storage that Pods reference, decoupling storage provisioning from consumption.

3

What is a "StatefulSet" and how does it differ from a "Deployment"?

B

Correct Answer

A StatefulSet manages Pods with stable, unique network identities and persistent storage that survives rescheduling, in a defined order — suited for stateful applications like databases — while a Deployment treats Pods as interchangeable and stateless

Explanation

StatefulSets provide stable network identities (e.g. "pod-0", "pod-1") and stable storage per Pod, with ordered, graceful deployment and scaling — important for clustered stateful applications.

4

What is the purpose of a Kubernetes "Ingress" resource?

B

Correct Answer

To manage external HTTP/HTTPS access to services within the cluster, typically providing features like host/path-based routing, TLS termination, and load balancing — requires an Ingress Controller to function

Explanation

Ingress defines rules for routing external HTTP/HTTPS traffic to internal Services based on hostnames or paths, but requires an Ingress Controller (e.g. nginx-ingress) to actually implement those rules.

5

What are the main types of Kubernetes Services, and what does "ClusterIP" provide?

B

Correct Answer

ClusterIP (the default type) exposes the Service on an internal IP reachable only within the cluster, while other types like NodePort and LoadBalancer expose it externally

Explanation

ClusterIP provides internal-only access; NodePort exposes the service on a static port on each node's IP; LoadBalancer provisions an external load balancer (typically via a cloud provider).

6

What is the purpose of "resource requests" and "resource limits" in a Pod spec?

B

Correct Answer

Requests are the minimum resources guaranteed and used by the scheduler to place Pods on nodes with capacity, while limits cap maximum usage, enforced at runtime (e.g. CPU throttling or OOM-killing for memory)

Explanation

The scheduler uses requests to decide which node has enough capacity for a Pod, while limits constrain actual usage at runtime — exceeding a memory limit can result in the container being OOMKilled.

7

What is a "DaemonSet" used for?

B

Correct Answer

To ensure that a copy of a Pod runs on every (or selected) node in the cluster, commonly used for node-level agents like log collectors or monitoring agents

Explanation

DaemonSets ensure exactly one Pod runs per matching node, ideal for cluster-wide infrastructure services like log shippers (e.g. Fluentd) or node monitoring agents.

8

What does the "kubectl rollout undo deployment/<name>" command do?

B

Correct Answer

Rolls back the deployment to its previous revision

Explanation

"kubectl rollout undo" reverts a Deployment to a previous revision, which Kubernetes tracks via its rollout history, useful for quickly undoing a problematic update.

9

What is the purpose of "node affinity" and "node selectors"?

B

Correct Answer

To constrain which nodes a Pod can be scheduled on, based on node labels — node selectors provide simple matching, while affinity rules support more expressive and flexible constraints, including preferred (soft) rules

Explanation

nodeSelector provides exact-match scheduling constraints based on node labels, while node affinity supports more expressive matching (operators like In, NotIn) and both required (hard) and preferred (soft) rules.

10

What is the difference between "Horizontal Pod Autoscaler" (HPA) and "Vertical Pod Autoscaler" (VPA)?

B

Correct Answer

HPA automatically adjusts the number of Pod replicas based on observed metrics like CPU or memory usage, while VPA automatically adjusts the resource requests/limits of existing Pods (potentially requiring a restart) based on usage

Explanation

HPA scales out/in by changing the number of Pods, while VPA scales up/down by adjusting the CPU/memory allocated to individual Pods — they address different scaling dimensions and can sometimes conflict if used together carelessly.

11

What is the purpose of "Taints" and "Tolerations" in Kubernetes scheduling?

A

Correct Answer

Taints mark nodes so that, by default, Pods cannot be scheduled on them unless they have a matching toleration, allowing nodes to repel certain Pods while permitting designated exceptions

Explanation

Taints applied to nodes repel Pods that don't have a matching toleration; this is the opposite of affinity (which attracts Pods) and is useful for dedicating nodes to specific workloads.

12

What is the purpose of "kubectl get events"?

B

Correct Answer

To view a chronological list of events in the cluster, such as Pod scheduling, image pulls, failures, and scaling actions, useful for debugging

Explanation

Events provide a record of what has happened in the cluster (e.g. "Successfully pulled image", "Failed scheduling"), valuable for diagnosing issues with Pods or other resources.

13

What is "Helm" and what problem does it solve?

B

Correct Answer

A package manager for Kubernetes that uses "charts" — templated collections of YAML manifests — to simplify defining, installing, and upgrading complex applications with configurable values

Explanation

Helm charts package related Kubernetes manifests as templates with configurable values, making it easier to manage versioned, reusable, and parameterized application deployments.

14

What does the "kubectl rollout restart deployment/<name>" command accomplish?

B

Correct Answer

It performs a rolling restart of all Pods in the deployment, recreating them one by one without downtime, even if the spec hasn't changed (e.g. to pick up an updated Secret)

Explanation

A rolling restart recreates Pods gradually following the same rolling update strategy, useful when underlying ConfigMaps/Secrets change but the Pod template itself hasn't, since Kubernetes doesn't automatically restart Pods on Secret/ConfigMap changes.

15

What is the purpose of an "init container" in a Pod?

B

Correct Answer

A specialized container that runs to completion before the main application containers start, often used for setup tasks like waiting for dependencies or preparing configuration files

Explanation

Init containers run sequentially before app containers and must complete successfully; they're useful for setup tasks that should finish before the main application starts.

16

What is a "sidecar container" pattern?

B

Correct Answer

A secondary container that runs alongside the main application container in the same Pod, providing supporting functionality like logging, monitoring, or proxying, sharing the Pod's network and storage

Explanation

Sidecars run alongside the main container, sharing its network namespace and volumes, commonly used for service mesh proxies (e.g. Envoy in Istio), log forwarders, or config reloaders.

17

What does "kubectl top pods" require to function, and what does it display?

B

Correct Answer

It requires the Metrics Server to be installed in the cluster, and displays real-time CPU and memory usage for pods

Explanation

"kubectl top" relies on the Metrics Server add-on to collect and expose resource usage metrics, which it then displays for nodes or pods.

18

What is the purpose of "Role-Based Access Control" (RBAC) in Kubernetes?

B

Correct Answer

To regulate access to Kubernetes API resources based on the roles of individual users or service accounts, using Roles/ClusterRoles and RoleBindings/ClusterRoleBindings to grant specific permissions

Explanation

RBAC defines "who can do what" within the cluster by binding permissions (verbs on resources, defined in Roles/ClusterRoles) to subjects (users, groups, or ServiceAccounts) via RoleBindings/ClusterRoleBindings.

19

What is the difference between a "Role" and a "ClusterRole" in RBAC?

B

Correct Answer

A Role grants permissions within a specific namespace, while a ClusterRole grants permissions cluster-wide (or can be used for namespaced resources across all namespaces, or for cluster-scoped resources)

Explanation

Roles are namespace-scoped, while ClusterRoles are cluster-scoped — they can grant access to cluster-scoped resources (like Nodes) or be reused across multiple namespaces via RoleBindings.

20

What does the "imagePullPolicy: Always" setting do?

A

Correct Answer

It causes the kubelet to always pull the image from the registry before starting the container, even if a version of the image already exists locally

Explanation

"imagePullPolicy: Always" forces a fresh pull on every Pod start, ensuring the latest version of a tag is used — important when using mutable tags like "latest", though it adds startup latency and registry load.

21

What is a "Headless Service" in Kubernetes?

B

Correct Answer

A Service created with "clusterIP: None", which does not get a cluster IP but instead returns the IPs of individual Pods directly via DNS, useful for stateful applications needing direct Pod addressing

Explanation

Headless Services skip load-balancing and cluster IP allocation, instead allowing DNS queries to resolve directly to the IPs of the backing Pods — commonly used with StatefulSets.

22

What is the purpose of "kubectl cordon" and "kubectl drain" on a node?

B

Correct Answer

"cordon" marks a node as unschedulable (preventing new Pods from being placed there), while "drain" additionally evicts existing Pods from the node gracefully, typically used before maintenance

Explanation

Cordoning prevents new Pods from being scheduled on a node, and draining evicts existing Pods (respecting PodDisruptionBudgets) — a common workflow before performing node maintenance or upgrades.

23

What is the purpose of a "PodDisruptionBudget" (PDB)?

B

Correct Answer

To limit the number of Pods of a replicated application that can be voluntarily disrupted (e.g. during node drains or rolling updates) at the same time, helping maintain availability

Explanation

PDBs specify a minimum available (or maximum unavailable) number of replicas during voluntary disruptions, ensuring operations like node drains don't take down too many replicas of a critical application simultaneously.

24

How does Kubernetes handle a Pod's restart when it crashes, in terms of "CrashLoopBackOff"?

B

Correct Answer

If a container repeatedly crashes, Kubernetes restarts it with an exponentially increasing delay between restarts (CrashLoopBackOff), to avoid overwhelming the system with rapid restart attempts

Explanation

CrashLoopBackOff is a status indicating the kubelet is repeatedly restarting a failing container with increasing backoff delays, often signaling an application startup error that needs investigation via logs.

25

What does "kubectl get all -n <namespace>" show, and what is a limitation of using "all" here?

B

Correct Answer

It shows commonly-used resources (Pods, Services, Deployments, etc.) in the specified namespace, but "all" does not include every resource type — some, like ConfigMaps, Secrets, and custom resources, are excluded by default

Explanation

"kubectl get all" covers a predefined set of common resource types but deliberately excludes some (like ConfigMaps and Secrets) — those need to be queried explicitly.

26

What is the purpose of "context" in kubectl configuration (kubeconfig)?

B

Correct Answer

A context groups together a cluster, a user (credentials), and a namespace, allowing kubectl to easily switch between different clusters or configurations using "kubectl config use-context"

Explanation

kubeconfig files can define multiple contexts (cluster + user + namespace combinations), letting users switch which cluster/credentials kubectl targets without re-authenticating each time.

27

What is the difference between "emptyDir" and "hostPath" volume types?

B

Correct Answer

emptyDir creates a temporary directory for the Pod's lifetime, initially empty and shared between its containers, deleted when the Pod is removed; hostPath mounts a file/directory from the host node's filesystem into the Pod

Explanation

emptyDir is ephemeral storage tied to the Pod's lifecycle (useful for scratch space or sharing data between containers in a Pod), while hostPath ties a Pod to a specific node's filesystem, which can cause issues if the Pod is rescheduled elsewhere.

28

What is the purpose of "kubectl apply --dry-run=client -o yaml"?

B

Correct Answer

It shows what the resulting resource configuration would look like without actually sending the request to the cluster, useful for previewing or generating YAML

Explanation

"--dry-run=client" processes the request locally without persisting it to the cluster, often combined with "-o yaml" to generate a manifest template that can be edited and applied later.

29

What is a "Network Policy" used for in Kubernetes?

B

Correct Answer

To specify how groups of Pods are allowed to communicate with each other and other network endpoints, effectively acting as a firewall at the Pod level

Explanation

NetworkPolicies define ingress/egress rules for Pods based on labels, namespaces, or IP blocks; they require a compatible CNI plugin (e.g. Calico) to actually enforce the rules.

30

What is the purpose of "annotations" versus "labels" on Kubernetes objects?

B

Correct Answer

Labels are used for identifying and selecting objects (and are subject to selector queries), while annotations attach arbitrary non-identifying metadata to objects, often used by tools for additional information without affecting selection

Explanation

Labels are meant for identifying/grouping resources via selectors (and have size/format restrictions for indexing), while annotations can hold larger, more arbitrary metadata (like build info or tool-specific configuration) not used for selection.

31

What does the "terminationGracePeriodSeconds" field in a Pod spec control?

B

Correct Answer

How long Kubernetes waits after sending a SIGTERM to a Pod's containers before forcefully killing them with SIGKILL, giving the application time to shut down gracefully

Explanation

When a Pod is deleted, Kubernetes sends SIGTERM and waits up to terminationGracePeriodSeconds (default 30s) for the process to exit cleanly before sending SIGKILL.

32

What is "kustomize" used for in Kubernetes configuration management?

B

Correct Answer

It allows customizing raw, template-free YAML configuration files for multiple purposes (e.g. different environments), using overlays that patch a common base configuration

Explanation

kustomize (built into kubectl via "kubectl apply -k") lets you maintain a base set of manifests and apply environment-specific overlays/patches without templating syntax, unlike Helm's templated approach.

33

What is the purpose of "QoS classes" (Guaranteed, Burstable, BestEffort) for Pods?

B

Correct Answer

Kubernetes assigns a Quality of Service class to each Pod based on its resource requests/limits configuration, which influences eviction order under node resource pressure — BestEffort Pods are evicted first, Guaranteed Pods last

Explanation

A Pod is "Guaranteed" if requests equal limits for all resources, "Burstable" if it has requests/limits but they differ, and "BestEffort" if none are set; under memory pressure, BestEffort Pods are evicted first.

34

What does "kubectl edit deployment <name>" do?

A

Correct Answer

Opens the deployment's current configuration in a text editor; saving changes applies them directly to the live resource

Explanation

"kubectl edit" opens the live resource's configuration in your default editor; upon saving, the changes are validated and applied directly to the cluster, similar to "apply" but interactive.

35

What is the purpose of "ServiceAccounts" in Kubernetes?

B

Correct Answer

They provide an identity for processes running in Pods to authenticate with the Kubernetes API, with permissions controlled via RBAC bindings

Explanation

Every Pod runs under a ServiceAccount (default if not specified), which provides an identity that can be granted specific API permissions via RBAC, enabling applications to interact with the Kubernetes API securely.

36

What is the difference between "RollingUpdate" and "Recreate" deployment strategies?

B

Correct Answer

RollingUpdate gradually replaces old Pods with new ones, maintaining availability during the update, while Recreate terminates all existing Pods before creating new ones, causing a brief period of downtime

Explanation

RollingUpdate (the default) incrementally replaces Pods to avoid downtime, while Recreate is simpler but causes downtime — sometimes necessary when old and new versions cannot run simultaneously.

37

What is the purpose of the "kubectl explain <resource>" command?

B

Correct Answer

It displays documentation for a resource type and its fields, including descriptions of the spec structure

Explanation

"kubectl explain" prints API documentation for a resource or field, helping users understand what fields are available and how to structure a manifest correctly.

38

What is the effect of setting "replicas: 0" on a Deployment?

B

Correct Answer

It scales the Deployment down so that no Pods are running, while keeping the Deployment object and its configuration intact for later scaling back up

Explanation

Setting replicas to 0 terminates all Pods managed by the Deployment but preserves its configuration, allowing it to be scaled back up later without redefining it.

39

What happens when a Pod's container exceeds its memory "limit"?

B

Correct Answer

The container is terminated by the kernel with an OOMKilled status, and depending on restartPolicy, the kubelet may restart it

Explanation

Unlike CPU limits which throttle, exceeding a memory limit causes the kernel's OOM killer to terminate the container, which is then reported as "OOMKilled" and restarted per the Pod's restart policy.

40

What is the purpose of "kubectl wait" in scripts and automation?

B

Correct Answer

To block until a specific condition (such as "Ready" or "Available") is met on one or more resources, useful for scripting deployment pipelines that need to wait for a rollout to finish

Explanation

"kubectl wait --for=condition=<condition>" polls a resource until the specified condition is satisfied or a timeout is reached, commonly used in CI/CD scripts to wait for rollouts to complete.

1

How does the Kubernetes "reconciliation loop" (control loop) pattern work, as implemented by controllers?

B

Correct Answer

Controllers continuously watch the current state of resources via the API server, compare it to the desired state defined in specs, and take corrective actions to converge the current state toward the desired state, repeating indefinitely

Explanation

This control loop pattern (observe, diff, act, repeat) is fundamental to Kubernetes — e.g. the Deployment controller continuously ensures the actual number of Pods matches the desired replica count.

2

What is a "Custom Resource Definition" (CRD), and how does it relate to the "Operator pattern"?

B

Correct Answer

A CRD lets users define custom resource types the Kubernetes API can manage like native ones; the Operator pattern combines CRDs with custom controllers encoding operational knowledge to automate managing complex apps like databases

Explanation

CRDs extend the Kubernetes API with custom resource types; Operators pair CRDs with custom controllers that implement domain-specific operational logic (backups, failover, scaling) for stateful applications.

3

How does "admission control" fit into the Kubernetes API request lifecycle, and what is the difference between "ValidatingAdmissionWebhook" and "MutatingAdmissionWebhook"?

B

Correct Answer

Admission controllers intercept requests after auth but before persistence; mutating webhooks can modify the object (e.g. injecting sidecars) and run first, while validating webhooks only accept or reject the resulting object

Explanation

The admission control phase sits between auth and persistence; mutating webhooks (which run first) can alter incoming objects (e.g. Istio's sidecar injector), while validating webhooks (running after mutation) enforce policy by accepting or rejecting the final object.

4

What is the role of "etcd" consistency guarantees (via the Raft consensus algorithm) in ensuring Kubernetes cluster reliability?

B

Correct Answer

etcd uses the Raft consensus algorithm to maintain a strongly consistent, replicated log across its members, ensuring that even if some etcd nodes fail, the cluster state remains consistent and a quorum can continue to serve reads/writes

Explanation

Raft ensures that a majority (quorum) of etcd members agree on every write before it is committed, providing strong consistency; this is why etcd clusters are typically deployed with an odd number of members (e.g. 3 or 5) to tolerate failures while maintaining quorum.

5

What is the difference between "horizontal scaling via HPA based on custom metrics" versus "based on CPU/memory metrics"?

B

Correct Answer

CPU/memory-based HPA relies on the built-in Metrics Server, while custom metrics (e.g. requests per second) require an extra pipeline like Prometheus Adapter implementing the custom/external metrics APIs, enabling scaling on app-specific signals

Explanation

Resource metrics (CPU/memory) come from the Metrics Server by default; scaling on custom or external metrics (like queue depth or request latency) requires registering additional APIs, commonly via the Prometheus Adapter, that the HPA controller can query.

6

How does Kubernetes's "Container Network Interface" (CNI) plugin architecture enable different networking implementations (e.g. Calico, Cilium, Flannel)?

B

Correct Answer

CNI defines a standard interface between runtimes and network plugins; Kubernetes invokes the configured plugin to set up Pod networking (IPs, routes), letting plugins offer features like policy enforcement or overlay networking without changing core code

Explanation

The CNI specification decouples Kubernetes from specific networking implementations — the kubelet calls the configured CNI plugin to set up each Pod's network namespace, letting operators choose plugins suited to their needs (e.g. Cilium for eBPF-based policy enforcement).

7

What is the significance of "Pod Security Standards" (or the deprecated PodSecurityPolicy) regarding container privilege levels?

B

Correct Answer

They define policy levels (Privileged, Baseline, Restricted) that constrain what Pods can do — such as running as root, using host namespaces, or mounting host paths — enforcing security best practices cluster-wide via admission control

Explanation

Pod Security Standards define graduated policy levels enforced via the built-in Pod Security Admission controller, restricting risky configurations (privileged containers, host namespace access, etc.) to reduce the cluster's attack surface.

8

Why might "ETCD" be deployed as a separate cluster from the Kubernetes control plane nodes in large production environments, and what is the trade-off?

B

Correct Answer

Running etcd on dedicated nodes isolates its resource usage (etcd is sensitive to disk I/O latency) from control plane components, improving reliability and performance, at the cost of additional infrastructure to manage and maintain

Explanation

etcd performance is highly sensitive to disk write latency; co-locating it with other control plane components under heavy load can cause latency spikes affecting the whole cluster, so dedicated etcd nodes (a "stacked" vs "external" topology trade-off) are common in large deployments.

9

What is the purpose of "finalizers" on Kubernetes objects, and how do they affect deletion?

B

Correct Answer

Finalizers are keys telling Kubernetes to wait until conditions handled by a controller are met before fully removing an object — on delete the object enters "Terminating" with a deletionTimestamp but persists until all finalizers are removed

Explanation

Finalizers let controllers perform cleanup logic (e.g. releasing external cloud resources) before an object is actually removed from etcd; an object stuck "Terminating" often indicates a finalizer whose controller isn't processing it.

10

How does "Pod-to-Pod" networking typically work across different nodes in a cluster at a conceptual level (the "Kubernetes networking model")?

B

Correct Answer

The Kubernetes networking model requires every Pod to get its own IP and that Pods can communicate with any other Pod across nodes without NAT, with the CNI plugin implementing this flat (or routed/overlay) network across the cluster

Explanation

A core Kubernetes networking requirement is that Pods are addressable by their own IPs across the entire cluster without NAT; CNI plugins implement this via various mechanisms (overlay networks like VXLAN, or direct routing with BGP).

11

What is "etcd compaction" and why is it necessary?

B

Correct Answer

etcd retains historical revisions of keys to support watch and multi-version concurrency control (MVCC); compaction removes old revisions beyond a retention point to prevent unbounded database growth, which could degrade performance or exhaust storage

Explanation

Because etcd is an MVCC store, every write creates a new revision; without periodic compaction, the keyspace history grows indefinitely, eventually causing "mvcc: database space exceeded" errors and requiring maintenance.

12

What does "topology spread constraints" allow you to configure for Pod scheduling, and how does it differ from anti-affinity?

B

Correct Answer

Topology spread constraints let you specify how Pods spread across domains (e.g. zones, nodes) using "maxSkew" to control allowed imbalance, giving finer, more scalable control than anti-affinity rules, which grow complex at scale

Explanation

While anti-affinity rules can approximate spreading by avoiding co-location, topology spread constraints provide a more direct and scalable mechanism (via maxSkew and topology keys) to balance Pods evenly across zones, nodes, or other domains.

13

What is the purpose of "server-side apply" in Kubernetes, and what problem does it solve compared to "client-side apply"?

B

Correct Answer

Server-side apply tracks field ownership per manager (tool/user), letting the API server merge changes from multiple actors reliably and detect conflicts, fixing overwrite issues caused by client-side apply's annotation between tools sharing an object

Explanation

Client-side apply relies on a client-computed diff stored in an annotation, which can conflict when multiple tools manage the same resource; server-side apply moves this logic to the API server, tracking which "manager" owns each field for more reliable collaborative management.

14

How do "leader election" mechanisms work for Kubernetes controllers (such as kube-controller-manager or custom Operators) running with multiple replicas for high availability?

B

Correct Answer

Multiple controller replicas run but use a distributed lock (a Lease object) to elect one active leader that performs reconciliation; if it fails or loses the lease, another replica takes over, giving high availability without conflicting actions

Explanation

Leader election via Lease objects ensures only one controller replica actively reconciles resources at a time (avoiding duplicate or conflicting actions), while standby replicas remain ready to take over quickly if the leader becomes unavailable.

15

What is the significance of "Pod overhead" in the context of running workloads with different container runtimes (e.g. gVisor or Kata Containers via RuntimeClass)?

B

Correct Answer

Sandboxed runtimes giving stronger isolation via lightweight VMs consume extra resources beyond the container's own request/limit; "Pod overhead" lets the scheduler account for this cost during placement, preventing nodes being over-committed

Explanation

RuntimeClass can specify a "overhead" field representing the extra resources consumed by the runtime's sandboxing mechanism (beyond the container itself), which the scheduler factors in to avoid overcommitting node resources.

16

How does "vertical cluster autoscaling" via Cluster Autoscaler differ from Pod-level autoscaling (HPA/VPA), and what triggers node scale-up/scale-down?

B

Correct Answer

Cluster Autoscaler adjusts the node count — scaling up when Pods can't be scheduled due to insufficient resources, and scaling down underused nodes whose Pods can be rescheduled — operating at the infrastructure level, unlike Pod-level HPA/VPA

Explanation

While HPA/VPA adjust Pod replica counts or resource allocations within existing capacity, Cluster Autoscaler changes the underlying infrastructure (node count) to provide or reclaim capacity, often working together with HPA in cloud environments.

17

What is the role of "ValidatingAdmissionPolicy" (a newer Kubernetes feature) compared to validating admission webhooks?

B

Correct Answer

ValidatingAdmissionPolicy lets you define validation rules declaratively using CEL directly in the API server, avoiding the latency, availability dependency, and overhead of running a separate webhook server for common cases

Explanation

By evaluating CEL expressions in-process within the API server, ValidatingAdmissionPolicy avoids the extra network hop, latency, and potential single point of failure that an external webhook server introduces, for policies expressible in CEL.

18

How does the "garbage collection" of Kubernetes objects work with respect to "ownerReferences"?

B

Correct Answer

Objects can declare an "ownerReference" pointing to another object (their owner); when the owner is deleted, the garbage collector automatically deletes dependent objects too (cascading deletion), unless an "orphan" deletion policy is specified

Explanation

ownerReferences establish parent-child relationships (e.g. a ReplicaSet owns its Pods); by default, deleting the owner cascades to delete dependents, though "kubectl delete --cascade=orphan" can leave dependents behind.

19

What is the difference between "kube-proxy" running in "iptables" mode versus "IPVS" mode for implementing Services?

B

Correct Answer

iptables mode implements Service load balancing using a chain of rules, which can bottleneck with very large Service counts due to linear evaluation, while IPVS mode uses a kernel hash table, offering better performance and more algorithms at scale

Explanation

IPVS uses an efficient hash table for service lookups (O(1) versus iptables' roughly linear chain traversal), making it more scalable for clusters with a very large number of Services, and supports additional load-balancing algorithms like least connection or weighted round robin.

20

What is the purpose of "Vertical Pod Autoscaler's" "Recreate" update mode, and what is its main drawback?

B

Correct Answer

In "Recreate" mode, VPA evicts and recreates Pods to apply new resource recommendations, since resource requests/limits cannot generally be changed on a running Pod; the drawback is that this causes Pod restarts, potentially disrupting running workloads

Explanation

Because (traditionally) a Pod's resource requests/limits are immutable once set, VPA in Recreate mode must evict the Pod and let its controller recreate it with updated resources — causing a disruption, which is why VPA is often used cautiously alongside PodDisruptionBudgets.