Kubernetes - Labels and SelectorsWhy does Kubernetes service routing rely on labels instead of pod IP addresses?ABecause services cannot access pod IPsBBecause IP addresses are not unique in KubernetesCBecause labels are faster to query than IPsDBecause pods are ephemeral and IPs can change, labels provide stable groupingCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand pod lifecyclePods can be created and destroyed frequently, changing their IP addresses.Step 2: Role of labels in stable routingLabels provide a stable way to group pods logically despite IP changes.Final Answer:Because pods are ephemeral and IPs can change, labels provide stable grouping -> Option DQuick Check:Labels provide stable grouping despite pod IP changes = A [OK]Quick Trick: Labels group pods stably despite changing IPs [OK]Common Mistakes:Thinking IPs are stable identifiersAssuming labels are faster than IPsBelieving services cannot access pod IPs
Master "Labels and Selectors" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes Kubernetes Fundamentals - Desired state vs actual state reconciliation - Quiz 13medium Kubernetes Fundamentals - Setting up a local cluster (minikube, kind) - Quiz 5medium Labels and Selectors - Adding labels to resources - Quiz 10hard Namespaces - Default namespaces overview - Quiz 7medium ReplicaSets and Deployments - Deployment status and history - Quiz 7medium Services - Headless services concept - Quiz 15hard kubectl Essential Commands - kubectl exec for container access - Quiz 9hard kubectl Essential Commands - kubectl port-forward for local access - Quiz 6medium kubectl Essential Commands - kubectl port-forward for local access - Quiz 10hard kubectl Essential Commands - kubectl get for listing resources - Quiz 5medium