Interview Q&A / Docker & Kubernetes

INTERVIEW Q&A · 67 QUESTIONS

Docker & Kubernetes interview questions

Images, containers, Dockerfiles, pods and deployments, from first principles.

  1. Explain the main parts of a Kubernetes Deployment YAML.

    apiVersion and kind identify the object, metadata names it, spec.replicas sets the count, spec.selector says which Pods it owns, and spec.template is the Pod blueprint whose labels must match the selector.

    BeginnerQuick answer1 min read
  2. What are the different Service types in Kubernetes?

    ClusterIP exposes a Service only inside the cluster, NodePort opens a port on every node, LoadBalancer provisions a cloud load balancer, and ExternalName maps the Service to an external DNS name.

    BeginnerQuick answer1 min read
  3. What happens when you delete a Pod that belongs to a Deployment?

    The ReplicaSet notices the count is below the desired replicas and immediately creates a replacement Pod with a new name and IP. To really remove the app, delete or scale the Deployment instead.

    BeginnerQuick answer1 min read
  4. What is a Pod in Kubernetes and why is it not just a container?

    A Pod is the smallest deployable unit in Kubernetes: one or more containers that share an IP address, ports and volumes and are always scheduled together on the same node. Most Pods hold one main container.

    BeginnerQuick answer1 min read
  5. What is a ReplicaSet and how does it relate to a Deployment?

    A ReplicaSet keeps a specified number of identical Pods running, replacing any that die. A Deployment manages ReplicaSets, creating a new one for each version to enable rolling updates and rollbacks.

    BeginnerQuick answer1 min read
  6. What is an Ingress in Kubernetes and how does it differ from a LoadBalancer Service?

    An Ingress defines HTTP and HTTPS routing rules by host and path, handled by an Ingress controller. One load balancer can serve many services, while a LoadBalancer Service creates one external load balancer per Service.

    BeginnerQuick answer1 min read