K8s - QnA

1. What are the key differences between a Deployment and a StatefulSet in Kubernetes? -> Deployment is stateless(nothing stored), StatefulSet stores data in the volume to process. -> Deployment pod name does not follow order, StatefulSet follows ordering of numbers. -> Deployment pod scaling are random, StatefulSet pod scaling follows strict order (new to old). -> Replaced pod get new name, StatefulSet pod gets the same name. -> Rolling updates can be fast and parallel, stateful deployments are ordered and controlled. 2. How would you safely perform a node upgrade in a Kubernetes cluster? -> Considering the question refers to node in Data plane. -> Cordon the node first to mark it as SCHEDULING DISABLED. -> Drain the node to let the pods to be created across other nodes. -> While draining we can ignore "daemon-sets". kubectl cordon: Prevent New Pods - Purpose: Marks a node as unschedulable. - Effect: No new pods will be scheduled on the node. - Ex...