Kubernetes Basics Questions with Answers

27 practice questions on Kubernetes Basics (Cloud Computing) with answers and step-by-step solutions. Try 10 samples below, then practise all 27 free in the AptiNest app.

Sample questions

Question 1Easy

Which control-plane component stores the cluster's state?

  1. etcd
  2. kube-proxy
  3. Ingress
  4. kubelet

Answer: A. etcd

Explanation

etcd is a consistent key-value store holding all cluster objects; the API server reads and writes it.

Step-by-step solution

  1. etcd is a consistent key-value store.
  2. It holds all cluster objects and state.
  3. The API server reads and writes it.

Why the other options are wrong

  • B. kube-proxy handles Service networking on nodes.
  • C. Ingress routes HTTP traffic.
  • D. The kubelet runs Pods on nodes.

Tip: etcd = the cluster's memory.

Question 2Easy

A batch task that must run to completion once, such as a data migration, should use a:

  1. DaemonSet
  2. Job
  3. Deployment
  4. Service

Answer: B. Job

Explanation

A Job runs Pods until a set number complete successfully; a CronJob schedules Jobs repeatedly.

Step-by-step solution

  1. The task must run to completion once.
  2. A Job runs Pods until they succeed.
  3. For repeated schedules, a CronJob creates Jobs.

Why the other options are wrong

  • A. DaemonSets run continuously on every node.
  • C. Deployments keep Pods running forever.
  • D. Services route traffic; they do not run tasks.

Tip: Run once = Job; run on schedule = CronJob.

Question 3Easy

What does the Horizontal Pod Autoscaler (HPA) do?

  1. Creates new nodes in the data centre by hand
  2. Moves Pods between namespaces
  3. Adjusts replica count based on metrics
  4. Adds more CPU cores to an existing Pod

Answer: C. Adjusts replica count based on metrics

Explanation

HPA scales out or in by adjusting replicas to keep a target metric, such as average CPU utilisation.

Step-by-step solution

  1. HPA watches a metric like average CPU.
  2. It compares it with the target.
  3. It increases or decreases the number of Pod replicas.

Why the other options are wrong

  • A. HPA does not create physical nodes.
  • B. It does not move Pods between namespaces.
  • D. Adding CPU to a Pod is vertical scaling.

Tip: Horizontal = more Pods; vertical = bigger Pods.

Question 4Easy

Which Service type exposes a set of Pods only inside the cluster?

  1. ExternalName
  2. NodePort
  3. ClusterIP
  4. LoadBalancer

Answer: C. ClusterIP

Explanation

ClusterIP is the default type and is reachable only from within the cluster.

Step-by-step solution

  1. ClusterIP is the default Service type.
  2. It gets an internal IP reachable only inside the cluster.

Why the other options are wrong

  • A. ExternalName maps to an external DNS name.
  • B. NodePort exposes the Service on each node's port.
  • D. LoadBalancer exposes it externally.

Question 5Medium

An Ingress in Kubernetes is used to:

  1. Route external HTTP traffic by host and path
  2. Store persistent data for Pods
  3. Schedule batch jobs at fixed times
  4. Run one Pod per node

Answer: A. Route external HTTP traffic by host and path

Explanation

An Ingress (with an ingress controller) provides L7 routing, often with TLS termination, to multiple Services.

Step-by-step solution

  1. An Ingress defines HTTP routing rules by host and path.
  2. An ingress controller applies them.
  3. Example: /api to the API Service, /shop to the shop Service.

Why the other options are wrong

  • B. Storage uses volumes.
  • C. Scheduled jobs use CronJobs.
  • D. One Pod per node is a DaemonSet.

Question 6Medium

In a Pod spec, what are resource requests used for?

  1. Setting the maximum disk size of the node
  2. Asking an admin to approve the Pod
  3. Requesting a new container image version
  4. Informing scheduling decisions

Answer: D. Informing scheduling decisions

Explanation

The scheduler places Pods on nodes with enough unreserved capacity for their requests; limits cap usage.

Step-by-step solution

  1. Requests state how much CPU and memory a container needs.
  2. The scheduler places the Pod only on a node with that much unreserved capacity.
  3. Limits, not requests, cap actual usage.

Why the other options are wrong

  • A. Requests do not set node disk size.
  • B. No admin approval is involved.
  • C. Image versions are set in the image field.

Tip: Requests = scheduling; limits = enforcement.

Question 7Medium

Non-sensitive configuration such as feature flags or a log level should be stored in a:

  1. ConfigMap
  2. PersistentVolumeClaim
  3. Secret
  4. DaemonSet

Answer: A. ConfigMap

Explanation

ConfigMaps hold non-confidential key-value configuration injected as environment variables or files.

Step-by-step solution

  1. Feature flags and log levels are not sensitive.
  2. Non-confidential config goes in a ConfigMap.
  3. It is injected as environment variables or files.

Why the other options are wrong

  • B. PVCs request storage.
  • C. Secrets are for sensitive data like passwords.
  • D. DaemonSets run Pods on every node.

Tip: Plain settings = ConfigMap; passwords = Secret.

Question 8Medium

Which Kubernetes object keeps a specified number of identical Pod replicas running and supports rolling updates?

  1. ConfigMap
  2. Secret
  3. Deployment
  4. PersistentVolume

Answer: C. Deployment

Explanation

A Deployment manages ReplicaSets, which maintain the replica count; changing the Pod template triggers a rolling update.

Step-by-step solution

  1. A Deployment declares the desired replica count and Pod template.
  2. It manages ReplicaSets to keep that many Pods running.
  3. Changing the template triggers a rolling update.

Why the other options are wrong

  • A. ConfigMaps hold configuration.
  • B. Secrets hold sensitive data.
  • D. PersistentVolumes provide storage.

Tip: Stateless app = Deployment.

Question 9Hard

A Pod's container keeps crashing and restarting, and kubectl shows the status CrashLoopBackOff. What does this indicate?

  1. The Pod has completed successfully
  2. The image could not be downloaded from the registry
  3. It keeps crashing, with growing delays
  4. The Pod is waiting for a node with enough resources

Answer: C. It keeps crashing, with growing delays

Explanation

CrashLoopBackOff means repeated crashes with increasing back-off delay; an image download failure shows ImagePullBackOff instead.

Step-by-step solution

  1. The container starts and then crashes.
  2. Kubernetes restarts it.
  3. Each restart waits longer (back-off), giving CrashLoopBackOff.

Why the other options are wrong

  • A. A successful Pod shows Completed.
  • B. An image download failure shows ImagePullBackOff.
  • D. Waiting for resources shows Pending.

Tip: CrashLoopBackOff? Run kubectl logs --previous.

Question 10Hard

Which statement about Kubernetes Secrets is accurate?

  1. They can only be read by the cluster administrator's laptop
  2. They are stored inside container images
  3. By default they are only base64-encoded, not encrypted
  4. They are always strongly encrypted with no extra setup

Answer: C. By default they are only base64-encoded, not encrypted

Explanation

Base64 is an encoding, not encryption; clusters should enable encryption at rest and restrict who can read Secrets.

Step-by-step solution

  1. Secrets are stored base64-encoded by default.
  2. Base64 is encoding, not encryption; anyone can decode it.
  3. Encryption at rest and access controls must be enabled separately.

Why the other options are wrong

  • A. Access depends on RBAC, not a particular laptop.
  • B. Secrets are separate objects, not in images.
  • D. Strong encryption needs extra setup.

Tip: Base64 is not security.

Practise all 27 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Cloud Computing topics · All topics