Interview Questions

Get ready for your next interview with our comprehensive question library

Kubernetes Administration Interview Questions

Filter by Difficulty

1.

What is Kubernetes and what are its main components?

beginner

Kubernetes is an open-source container orchestration platform that automates deployment, scaling, and management of containerized applications. The main components include:
Master Node Components:

  • API Server: Central management component that exposes the Kubernetes API
  • etcd: Distributed key-value store that stores cluster state and configuration
  • Controller Manager: Runs controllers that regulate cluster state
  • Scheduler: Assigns pods to nodes based on resource requirements
    Worker Node Components:
  • kubelet: Agent that communicates with the API server and manages pods
  • kube-proxy: Network proxy that maintains network rules
  • Container Runtime: Software that runs containers (Docker, containerd, CRI-O)
2.

Explain the difference between Pods, Services, and Deployments.

beginner
  • Pod: The smallest deployable unit in Kubernetes, containing one or more containers that share storage and network. Pods are ephemeral and typically not created directly.
  • Deployment: Higher-level abstraction that manages ReplicaSets and provides declarative updates to Pods. It ensures the desired number of pod replicas are running.
  • Service: Abstraction that defines a logical set of Pods and provides stable networking. It enables communication between different parts of an application.
    Example:
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.20
3.

What are Kubernetes namespaces and why are they used?

beginner

Namespaces provide a way to partition cluster resources between multiple users or teams. They create virtual clusters within a physical cluster, enabling:

  • Resource isolation: Separate environments (dev, staging, prod)
  • Access control: Different permissions for different teams
  • Resource quotas: Limit resource consumption per namespace
  • Name scoping: Same resource names can exist in different namespaces
kubectl create namespace development
kubectl get pods --namespace=development
4.

What are the different types of Services in Kubernetes?

beginner

Service types determine how services are exposed:

  1. ClusterIP (default): Internal cluster access only
  2. NodePort: Exposes service on each node's IP at a static port
  3. LoadBalancer: Exposes service externally using cloud provider's load balancer
  4. ExternalName: Maps service to external DNS name
# NodePort Service
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: NodePort
  selector:
    app: myapp
  ports:
  - port: 80
    targetPort: 8080
    nodePort: 30007
5.

How do you troubleshoot a pod that's not starting?

beginner

Systematic troubleshooting approach:

# Check pod status
kubectl get pods -o wide
# Describe pod for events
kubectl describe pod <pod-name>
# Check logs
kubectl logs <pod-name>
# Check previous container logs if restarting
kubectl logs <pod-name> --previous
# Check node resources
kubectl top nodes
kubectl describe node <node-name>

Common issues:

  • Image pull errors: Check image name, registry access, secrets
  • Resource constraints: Insufficient CPU/memory on nodes
  • Configuration errors: Invalid environment variables, missing secrets
  • Network issues: DNS resolution, service connectivity
6.

Explain the Pod lifecycle and its phases.

intermediate

Pod lifecycle phases:

  1. Pending: Pod accepted by cluster but containers not yet created
  2. Running: Pod bound to node, all containers created, at least one running
  3. Succeeded: All containers terminated successfully
  4. Failed: All containers terminated, at least one failed
  5. Unknown: Pod state cannot be determined
    Additional states include init containers, readiness/liveness probes, and termination grace periods. Understanding this is crucial for troubleshooting deployment issues.
7.

How do you perform a rolling update in Kubernetes?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
8.

What is a DaemonSet and when would you use it?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
9.

Explain StatefulSets vs Deployments. When would you use each?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
10.

How do you configure resource requests and limits?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
11.

What are init containers and how are they used?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
12.

Explain Kubernetes networking model and how pod-to-pod communication works.

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
13.

How do Ingress controllers work and why are they needed?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
14.

Explain Network Policies and provide an example.

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
15.

Explain the difference between Volumes, Persistent Volumes, and Persistent Volume Claims.

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
16.

What are Storage Classes and how do they enable dynamic provisioning?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
17.

How do you handle persistent storage for stateful applications?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
18.

Explain RBAC in Kubernetes and how to implement it.

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
19.

What are Pod Security Standards and how do you implement them?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
20.

How do you secure secrets in Kubernetes?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
Showing 1 to 20 of 40 results

Premium Plan

$10.00 /monthly
  • Access all premium content - interview questions, and other learning resources

  • We regularly update our features and content, to ensure you get the most relevant and updated premium content.

  • 1000 monthly credits

  • Cancel anytime