Thursday, 11 April 2024

Kubernetes Interview Questions

Here are some Kubernetes interview questions. Good Luck!




kubectl



Security


Workloads

Cron Jobs
...

Daemon Sets
...

Deployments

  • What happens if deployment fails for e.g. AWS Secrets Manager does not have a key in some secret and that key's value is used as a value of env var defined in pod template. Does k8s try to restart the pod? Which part of k8s control plane deals with this?

Jobs
...

Pods

  • What are the IDs in the pod name like in this example: my-app-29361181-apzjq 
  • Explain each pod status type:
    • ContainerCreating
    • Completed
    • Running
    • Container




Replica Sets
...

Replication Controllers
...

Stateful Sets
...

Service


Ingresses

...

Ingress Classes

...

Services


Config and Storage


Config Maps


Persistent Volume Claims

  • How to check the total storage allocated for nodes in a cluster?
  • Which kubectl command shows all PVCs?
  • Explain each column that kubectl get pv shows in its output:
    • NAME
    • CAPACITY
    • ACCESS MODES
    • RECLAIM POLICY
    • STATUS
    • CLAIM
    • STORAGECLASS
    • VOLUMEATTRIBUTESCLASS
    • REASON
    • AGE

Secrets

Storage Classes

Cluster


Cluster Role Bindings
Cluster Roles
Events
Namespaces
Network Policies
Nodes
Persistent Volumes
Role Bindings
Roles
Service Accounts

Custom Resource Definitions

...

Debugging

  • Pod stuck in CrashLoopBackOff, no logs, no errors.
    • How do you debug beyond kubectl logs and describe?
  • A StatefulSet pod won’t reattach its PVC after a node crash.
    • How do you recover without recreating storage?
  • Pods are Pending, Cluster Autoscaler won’t scale up.
    • Walk me through your top 3 debugging steps.
  • NetworkPolicy blocks cross-namespace traffic.
    • How do you design least-privilege rules and test them safely?
  • Service must connect to an external DB via VPN inside the cluster.
    • How do you architect it for HA + security?

Security and Architecture

  • Running a multi-tenant EKS cluster.
    • How do you isolate workloads with RBAC, quotas, and network segmentation?
  • Kubelet keeps restarting on one node.
    • Where do you look first – systemd, container runtime, or cgroups?
  • Critical pod got evicted due to node pressure.
    • Explain QoS classes and eviction policies.
  • A rolling update caused downtime.
    • What went wrong in your readiness/startup probe or deployment config?
  • Ingress Controller fails under load.
    • How do you debug and scale routing efficiently?

Performance and Reliability

  • Istio sidecar consumes more CPU than your app.
    • How do you profile and optimise mesh performance?
  • etcd is slowing down control plane ops.
    • Root causes + how do you tune it safely?
  • You must enforce images from a trusted internal registry only.
    • Gatekeeper, Kyverno, or custom Admission Webhook – what’s your move?
  • Pods stuck in ContainerCreating forever.
    • CNI attach delay? OverlayFS corruption? Walk me through your root-cause process.
  • Random DNS failures in Pods.
    • How do you debug CoreDNS, kube-proxy, and conntrack interactions?

To Be Continued...

No comments: