All interview guides

Kubernetes Interview Questions and Answers

24 questions that come up in Kubernetes technical interviews, each with the answer and an explanation of why it is right.

Test yourself — 90 question bank

1. What is RBAC in Kubernetes?

Advanced

Answer: Role-Based Access Control for authorization

RBAC is a method for regulating access to resources. Uses Roles/ClusterRoles to define permissions and Bindings to assign them.

2. What is Kubernetes?

Beginner

Answer: An open-source container orchestration platform

Kubernetes (K8s) is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications.

3. What is the difference between Role and ClusterRole?

Advanced

Answer: Role is namespaced, ClusterRole is cluster-wide

Role grants permissions within a namespace. ClusterRole grants cluster-wide permissions or access to cluster-scoped resources.

4. What is a Pod in Kubernetes?

Beginner

Answer: The smallest deployable unit containing one or more containers

A Pod is the smallest deployable unit in Kubernetes. It represents one or more containers that share network and storage resources.

5. What is kubectl?

Beginner

Answer: Command-line tool for interacting with Kubernetes

kubectl is the command-line tool for communicating with a Kubernetes cluster. It allows you to run commands against clusters.

6. How do you mount a ConfigMap as environment variables?

Intermediate

Answer: Both a and b

Use envFrom with configMapRef in Pod spec to mount ConfigMap as environment variables. All keys become environment variables.

7. What is a Custom Resource Definition (CRD)?

Advanced

Answer: Extends Kubernetes API with custom resource types

CRD extends the Kubernetes API by defining custom resource types. Enables operators and custom controllers for domain-specific resources.

8. Which command lists all Pods?

Beginner

Answer: kubectl get pods

`kubectl get pods` lists all Pods in the current namespace. Add `-A` or `--all-namespaces` to see Pods across all namespaces.

9. What is an Operator?

Advanced

Answer: Application-specific controller using CRDs

Operator is application-specific controller that uses CRDs. Automates operational tasks like deployment, scaling, backup, recovery.

10. What is the Operator pattern?

Advanced

Answer: Codifies operational knowledge into software

Operator pattern codifies operational knowledge into software. Custom controller watches custom resources and takes action to maintain desired state.

11. What is a Namespace in Kubernetes?

Beginner

Answer: Virtual cluster for logical isolation

Namespaces provide logical isolation for resources within a cluster. They enable multi-tenancy and resource organization.

12. What is a Service in Kubernetes?

Beginner

Answer: Stable network endpoint that abstracts access to Pods

A Service is an abstraction that defines a logical set of Pods and a policy to access them. It provides stable networking and load balancing.

13. What is Helm?

Advanced

Answer: Package manager for Kubernetes using charts

Helm is a package manager for Kubernetes. Uses charts (packages) with templates to simplify application deployment and management.

14. What is a Deployment?

Beginner

Answer: Manages ReplicaSets and provides declarative updates for Pods

A Deployment manages ReplicaSets and provides declarative updates for Pods. It handles rolling updates, rollbacks, and scaling.

15. What is a Helm Chart?

Advanced

Answer: Package of Kubernetes resources with templates

Helm Chart is a package containing Kubernetes resource templates and default values. Charts are reusable and can be shared via repositories.

16. What is Kustomize?

Advanced

Answer: Template-free customization with overlays

Kustomize provides template-free customization of Kubernetes configs. Uses overlays and patches. Integrated into kubectl with -k flag.

17. What is an Ingress?

Intermediate

Answer: Manages external HTTP/HTTPS access to Services

Ingress manages external access to Services, typically HTTP/HTTPS. Provides load balancing, SSL termination, and name-based virtual hosting.

18. What is the control plane in Kubernetes?

Beginner

Answer: Set of components that manage the cluster

The control plane manages the Kubernetes cluster. Components include API server, scheduler, controller manager, and etcd.

19. What is an Ingress Controller?

Intermediate

Answer: Implements Ingress rules as Pods

Ingress Controller implements Ingress rules. It must be installed separately (nginx-ingress, traefik, etc.) and runs as Pods.

20. What is the Admission Controller?

Advanced

Answer: Intercepts API requests before persisting to etcd

Admission Controllers intercept API requests before persisting to etcd. Can validate or mutate requests. Examples: PodSecurityPolicy, ResourceQuota.

21. What is a DaemonSet?

Intermediate

Answer: Ensures Pod runs on all Nodes

DaemonSet ensures a copy of a Pod runs on all (or some) Nodes. Used for node-level services like log collection and monitoring.

22. What is a StatefulSet?

Intermediate

Answer: Manages stateful applications with stable identities

StatefulSet manages stateful applications. Provides stable network identities, persistent storage, and ordered deployment/scaling.

23. What is a ValidatingAdmissionWebhook?

Advanced

Answer: Custom admission controller that validates and can reject requests

ValidatingAdmissionWebhook validates objects and can reject requests. Runs after mutating webhooks. Used for custom validation logic.

24. How do you create resources from a YAML file?

Beginner

Answer: kubectl apply -f file.yaml

`kubectl apply -f file.yaml` creates or updates resources declaratively. `kubectl create -f` also works but apply is preferred for updates.

Ready to test yourself?

The full Kubernetes bank has 90 questions across 3 difficulty levels — timed, shuffled, and scored.

Take the Kubernetes quiz