Kubernetes Interview Questions on Workloads and Scheduling

Kubernetes interview answers should connect API objects, controllers, scheduling and useful application behaviour. Explain what each component controls and which evidence remains missing. A Bound volume claim does not prove that a Pod can use its storage on every node. The fictional topology case below pairs a zone-constrained volume with an incompatible Pod node selector.

Aug 27, 2023 - 04:23
Updated: 
103.2k

Kubernetes in IT Infrastructure · Interview preparation

Kubernetes Interview Questions on Workloads and Scheduling

Quick answer: Kubernetes interview answers should connect API objects, controllers, scheduling and useful application behaviour. Explain what each component controls and which evidence remains missing. A Bound volume claim does not prove that a Pod can use its storage on every node. The fictional topology case below pairs a zone-constrained volume with an incompatible Pod node selector. It demonstrates how to reason from supplied requirements without creating a cluster, changing storage or treating every Pending Pod as a shortage of CPU.

Key takeaways

  • A controller reconciles desired state through particular API resources.
  • Pod phase, container state and readiness are different signals.
  • Bound storage still has topology and access constraints.
  • Autoscaling needs usable metrics and capacity.
  • RBAC, Secrets and NetworkPolicy each have their own scope.

Table of Contents

How should you explain Kubernetes architecture?

1. What is Kubernetes? It orchestrates containerised workloads through APIs and reconciliation. It does not automatically supply every application dependency or operational guarantee.

2. What is the control plane? The API server exposes the API, etcd stores cluster state, and controllers and schedulers perform their respective reconciliation and placement work.

3. What runs on a worker? A kubelet manages assigned Pods through a compatible container runtime; networking and other components implement the cluster’s chosen design.

4. Does Kubernetes require Docker Engine? No. It uses compatible Container Runtime Interface implementations. Docker-built compatible images and Docker Engine as a runtime are separate questions.

5. What is a namespace? A scope for many object names and administrative policies. It is not automatically a complete security or network-isolation boundary.

Which Pod and controller answers commonly follow?

6. Pod versus container? A Pod groups containers sharing selected execution context, including networking and applicable storage. The Kubernetes Pod lifecycle guide distinguishes Pod phase from individual container states.

7. Does Running prove readiness? No. Inspect readiness and application behaviour separately; a Pod can be running while unable to serve its intended workload.

8. Deployment versus ReplicaSet? A Deployment manages desired rollout behaviour through ReplicaSets; a ReplicaSet maintains a selected replica count.

9. StatefulSet versus Deployment? StatefulSets support stable identities and ordered behaviours for suitable workloads. They do not automatically configure correct database replication or protected backups.

10. DaemonSet versus Job? A DaemonSet places Pods on eligible nodes; a Job manages completion work. A CronJob schedules Jobs, with concurrency and missed-run behaviour needing review.

11. Does a rolling update guarantee zero downtime? The Kubernetes Deployment guide describes surge and unavailability controls. Capacity, readiness, connection handling and application compatibility still determine user impact.

How do networking, configuration and access objects differ?

12. Service versus Pod IP? A Service provides a stable abstraction for selected backends, while Pods can be replaced. Selectors and endpoint conditions affect the actual path.

13. ClusterIP, NodePort and LoadBalancer? They expose services through different mechanisms. External implementation, routing and provider behaviour must be considered for reachability.

14. Ingress versus Service? An Ingress describes supported HTTP routing rules interpreted by an implementation; a Service identifies backend access. An API object alone does not install a working controller.

15. ConfigMap versus Secret? They distinguish ordinary configuration from sensitive data intent. Base64 is not encryption, and the Kubernetes Secret guide recommends encryption at rest and restricted access.

16. What does RBAC decide? Permission for API actions on resources within the applicable scope. Application authorisation and container process permissions remain separate.

17. What does NetworkPolicy require? An implementation that enforces it. The Kubernetes NetworkPolicy guide explains selection and ingress/egress rules; merely creating a policy does not prove enforcement.

Object or signalQuestion it helps answerSeparate question
DeploymentDesired rollout and replicasCan customers complete a transaction?
SecretSensitive configuration distributionWho can retrieve it, and is storage encrypted?
NetworkPolicySelected traffic policyDoes the installed network implementation enforce it?
PVC BoundClaim-to-volume associationCan a compatible node access the volume?

Which scheduling and scaling answers need conditions?

18. Requests versus limits? Requests inform resource allocation and scheduling; limits constrain applicable usage through runtime mechanisms. Missing capacity and an application memory problem are different diagnoses.

19. nodeSelector versus affinity? Both can constrain placement; affinity expresses richer required or preferred relationships. Preferred rules do not provide the same guarantee as required rules.

20. Taints versus tolerations? Taints repel Pods lacking matching tolerations. A toleration permits consideration but does not independently guarantee placement.

21. HPA versus VPA? Horizontal scaling changes replica counts; vertical scaling concerns resource recommendations or changes through the relevant implementation. The Kubernetes horizontal-autoscaling guide describes HPA metrics APIs and limits; metrics availability and usable capacity matter.

22. Why can a Pod be Pending? Scheduling constraints, storage, resources or startup preparation may be involved. Read conditions and events in context instead of diagnosing from the phase alone.

What should you say about persistent storage?

23. PV versus PVC? A PersistentVolume represents storage available to the cluster; a PersistentVolumeClaim requests storage for a workload. Their binding is not a guarantee that every node can access it.

24. What does StorageClass describe? Provisioning and related storage policy. The Kubernetes StorageClass guide explains volume binding modes and driver-specific capabilities.

25. What does WaitForFirstConsumer change? It can delay binding or provisioning until workload scheduling constraints are known, for supported volume implementations. It does not automatically relocate data in an already Bound volume.

26. What do access modes mean? They describe supported mounting relationships, not application-level permissions or automatic write protection for every use.

27. Does deleting a Pod delete its persistent data? Data lifetime depends on the storage objects and policies, not simply the process lifetime. Reclaim policy and owner procedures require separate review.

Why can a Pod remain Pending with a Bound claim?

In an invented interview record, PVC reports Bound to a volume whose node affinity permits zone A only. The Pod’s required node selector permits zone B only. Supplied inventory contains nodes in both zones, but none satisfies both requirements.

The Kubernetes PersistentVolume guide states that volume node affinity constrains where a consuming Pod can be scheduled. Bound establishes an association; it does not cancel that constraint. Adding more zone-B CPU alone would not resolve this stated mismatch.

Ask the application and storage owners which placement is intended, what data must be retained and whether an approved compatible placement or data migration is appropriate. Do not recommend deleting the claim merely to clear Pending. For future supported provisioning, review binding mode and topology together.

Invented supplied recordMeaning for this case
PVC is BoundA volume association exists
PV requires zone AConsuming placement must respect that storage constraint
Pod requires zone BThe workload excludes zone-A nodes
No node satisfies bothReview intended topology with owners before any change

How do troubleshooting, security and extension answers finish?

28. Logs versus events? Container logs describe application output; events and conditions can describe scheduling or lifecycle observations. Their retention and completeness differ.

29. Liveness versus readiness? Liveness can trigger container restart after configured failures; readiness influences service eligibility. A broken dependency check can make a poorly designed liveness policy disruptive.

30. CRD versus controller? A custom resource definition adds API schema and storage for a resource type. A separate controller supplies the reconciliation behaviour expected by an Operator.

31. What belongs in an operational answer? Identify namespace, object identity, desired configuration, current conditions, relevant dependencies and the authorised owner. In the topology case, retain both conflicting requirements and the proposed decision for review; a general restart would not explain or resolve the conflict.

Related reading: Kubernetes interview foundations; OpenShift command and state interpretation.

References

Frequently Asked Questions

Pod phase summarises lifecycle information, while readiness conditions and actual application acceptance provide different evidence about useful service behaviour.

Kubernetes uses compatible CRI implementations, while running compatible images built with Docker is a separate concern from runtime selection.

Namespaces scope many objects, but network isolation needs suitable policy and an enforcing implementation rather than the namespace name alone.

Base64 is an encoding, so protect stored Secrets and restrict retrieval through the applicable configuration and access-control arrangements.

The bound volume can still impose topology constraints that conflict with workload placement requirements or available eligible nodes.

It concerns supported binding and provisioning timing, rather than automatically moving existing stored data into another zone or failure domain.

A toleration permits consideration despite matching taints, while selectors, affinity, resources and other scheduling constraints still need to be satisfied.

The topology records are invented and interpreted on paper, with no cluster creation, YAML application, storage deletion or live command execution.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Aayushi Sinha

With a passion for staying on the cutting edge of technology trends, I am dedicated to delivering content that not only informs but also inspires. Whether you need in-depth analysis pieces, informative guides, or thought-provoking opinion pieces, I craft content that resonates with tech enthusiasts and professionals alike.