Loading video player...
šØ "What happens when you run kubectl apply -f deployment.yaml?" This is one of the most asked Kubernetes interview questions at senior and mid level DevOps engineer roles ā and most candidates only scratch the surface of the answer. In this video I'll walk you through the complete internal flow of what happens inside Kubernetes from the moment you hit enter on kubectl apply all the way to your container actually running on a node ā step by step, component by component! āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā šÆ WHY THIS QUESTION IS SO IMPORTANT IN INTERVIEWS This question is not just about kubectl. It is a test of whether you truly understand how Kubernetes works as a system ā how all the components talk to each other, what role each component plays and in what order everything happens. A junior engineer says "it creates the pods." A senior engineer walks through kube-apiserver, etcd, kube-controller-manager, kube-scheduler and kubelet and explains what each one does in the flow. That difference in answer is what gets you the job. āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā š WHAT YOU WILL LEARN IN THIS VIDEO ā What kubectl does before even sending the request ā How kube-apiserver handles authentication and authorization ā What admission controllers are and why they matter ā How etcd stores the desired state of your cluster ā What kube-controller-manager does and how ReplicaSet is created ā How kube-scheduler picks the right node for your pod ā How kubelet on the node actually starts your container ā What role container runtime like containerd plays ā How kube-proxy updates network rules for the new pod ā How to give a complete and impressive answer in interviews āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā š WHO IS THIS VIDEO FOR This video is perfect for you if you are: š A DevOps engineer preparing for mid or senior level interviews š Someone preparing for CKA or CKAD certification exams š A developer who wants to understand Kubernetes internals deeply š An SRE or platform engineer managing Kubernetes in production š Anyone who has been asked this question and only answered "it creates the deployment and pods" āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā š” COMPLETE FLOW ā kubectl apply TO RUNNING CONTAINER Step 1 ā kubectl validates YAML locally ā Reads your dep.yaml file ā Validates syntax and schema before sending anything ā Converts YAML to JSON REST API request Step 2 ā Request hits kube-apiserver ā First point of contact for all requests in Kubernetes ā Authenticates who is making the request ā Authorizes via RBAC whether they have permission Step 3 ā Admission Controllers run ā MutatingAdmissionWebhook can modify the request ā ValidatingAdmissionWebhook can reject invalid requests ā This is where sidecar injection happens automatically Step 4 ā Desired state saved to etcd ā kube-apiserver writes the Deployment spec to etcd ā etcd is the single source of truth for your entire cluster ā Your Deployment now exists but nothing is running yet Step 5 ā kube-controller-manager acts ā Deployment Controller detects new desired state in etcd ā Creates a ReplicaSet to manage the required number of pods ā ReplicaSet Controller creates Pod objects in etcd Step 6 ā kube-scheduler assigns nodes ā Scheduler watches for pods with no node assigned ā Evaluates all nodes based on resources, taints and affinity ā Assigns the best node to each pod and updates etcd Step 7 ā kubelet starts the container ā kubelet on the assigned node watches for pods assigned to it ā Talks to container runtime (containerd) to pull the image ā Container runtime pulls image and starts the container ā kubelet monitors and reports pod status back to API server Step 8 ā kube-proxy updates network rules ā Updates iptables or IPVS rules on all nodes ā Ensures the new pod is reachable via Kubernetes Service ā Traffic can now flow to your newly running pod āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā š SUBSCRIBE TO ayushbuildstech If you are serious about cracking DevOps and Kubernetes interviews and learning real world concepts with hands on demos ā Subscribe to ayushbuildstech and hit the bell icon so you never miss a video! Every video on this channel covers: ā Real Kubernetes interview questions asked in top companies ā Hands on live demos so you actually understand the concept ā Clear explanations that even beginners can follow ā Production level knowledge that helps you on the job too āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā š FOUND THIS HELPFUL? If this video helped you understand Kubernetes internals clearly ā smash the Like button! It helps this video reach more DevOps engineers who need this content. š¬ COMMENT BELOW: Were you able to answer this question before watching this video? Comment YES or NO below ā would love to know! āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā #Kubernetes #kubectl #DevOps #KubernetesInterview #KubernetesInternals #DevOpsInterview #KubernetesTutorial #ayushbuildstech