Interview Q&A / Docker & Kubernetes

INTERVIEW Q&A · 67 QUESTIONS

Docker & Kubernetes interview questions

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

  1. 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
  2. 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
  3. What are init containers in Kubernetes and when would you use them?

    Init containers run one after another, to completion, before the app containers start. Use them for setup such as waiting for a database, running migrations or fetching config. If one fails, the Pod restarts it.

    IntermediateQuick answer1 min read
  4. What is a sidecar container in a Kubernetes Pod?

    A sidecar is a helper container running in the same Pod as the main app, sharing its network and volumes. Common uses are log shippers, proxies such as Envoy, and config reloaders.

    IntermediateQuick answer1 min read