Kubernetes - ReplicaSets and DeploymentsYou notice your Deployment's desired replicas is 5 but actual replicas stays at 3. Which is the most likely cause?APods are stuck in Pending state due to resource limitsBDeployment YAML has syntax errorsCkubectl command was typed incorrectlyDActual replicas always match desired replicas instantlyCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand why actual replicas lag behind desiredIf actual replicas are less than desired, pods may be stuck starting, often due to resource constraints.Step 2: Eliminate other optionsSyntax errors prevent deployment creation, incorrect kubectl commands won't show this state, and actual replicas do not update instantly.Final Answer:Pods are stuck in Pending state due to resource limits -> Option AQuick Check:Pending pods cause actual < desired replicas [OK]Quick Trick: Check pod status if actual replicas < desired replicas [OK]Common Mistakes:Assuming syntax errors cause replica mismatchExpecting instant replica count updateIgnoring pod scheduling issues
Master "ReplicaSets and Deployments" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes Labels and Selectors - Why labels organize resources - Quiz 6medium Labels and Selectors - Label selectors (equality, set-based) - Quiz 3easy Pods - Init containers - Quiz 6medium ReplicaSets and Deployments - ReplicaSet definition - Quiz 2easy ReplicaSets and Deployments - Recreate update strategy - Quiz 9hard ReplicaSets and Deployments - Creating Deployments with YAML - Quiz 10hard Services - Service selectors and labels - Quiz 10hard Services - Headless services concept - Quiz 6medium kubectl Essential Commands - kubectl explain for API reference - Quiz 2easy kubectl Essential Commands - kubectl exec for container access - Quiz 3easy