Назад к подготовке

Вопрос про production ML

Explain the difference between a Kubernetes pod, service, deployment and node.

Ответить самому

Сначала сформулируйте ответ как на собеседовании, затем откройте разбор и оцените себя.

Загрузка

Короткий ответ

A node is a worker machine, a pod is the smallest schedulable unit containing one or more containers, a deployment manages desired replicas and rollouts, and a service provides stable networking/load balancing to pods.

Полный разбор

A Kubernetes node is a worker machine, physical or virtual, that runs pods. It has the kubelet, container runtime and networking needed to host workloads.

A pod is the smallest schedulable Kubernetes unit. It usually contains one application container, but can contain tightly coupled sidecars that share network namespace and volumes. Pods are ephemeral; they can be killed and recreated with different IPs.

A deployment is a controller for stateless replicated workloads. It manages a ReplicaSet, desired replica count, rolling updates, rollbacks and pod template changes. You normally update a deployment rather than creating pods manually.

A service gives a stable network identity and load-balancing abstraction over a set of pods selected by labels. Because pod IPs change, clients usually call the service DNS/name rather than individual pods.

Теория

Pods run containers, deployments manage pods, services route to pods, and nodes provide the machines where pods run.

Типичные ошибки

  • Call a pod a machine rather than a schedulable workload unit.
  • Confuse deployment with the act of releasing code.
  • Forget that services select pods by labels and hide changing pod IPs.

Как отвечать на собеседовании

  • Answer with one sentence per primitive, then connect them through a deployment creating pods on nodes behind a service.
  • Use a model-serving example if the interviewer comes from ML platform work.