Kubernetes - TroubleshootingYou want to debug why a pod cannot reach a service by DNS name. Which two commands help diagnose this issue?Akubectl logs pod and kubectl get podsBkubectl exec pod -- nslookup <service-name> and kubectl get endpoints <service-name>Ckubectl describe service and kubectl get nodesDkubectl get configmaps and kubectl get secretsCheck Answer
Step-by-Step SolutionSolution:Step 1: Use nslookup inside podnslookup tests DNS resolution of service name from pod.Step 2: Check endpoints for serviceEndpoints confirm if service routes to pods exist.Final Answer:kubectl exec pod -- nslookup <service-name> and kubectl get endpoints <service-name> -> Option BQuick Check:DNS + endpoints = diagnose service reachability [OK]Quick Trick: Use nslookup and get endpoints to debug service DNS issues [OK]Common Mistakes:Checking logs unrelated to DNSGetting nodes instead of endpointsChecking configmaps and secrets irrelevant here
Master "Troubleshooting" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes Advanced Deployment Patterns - Blue-green deployments - Quiz 10hard Helm Package Manager - Adding chart repositories - Quiz 2easy Monitoring and Logging - Metrics Server installation - Quiz 10hard Monitoring and Logging - Kubernetes dashboard - Quiz 10hard Production Best Practices - Multi-cluster management concept - Quiz 8hard Production Best Practices - Pod Disruption Budgets - Quiz 3easy RBAC and Security - Image security scanning - Quiz 3easy RBAC and Security - Roles and ClusterRoles - Quiz 14medium Service Mesh - Traffic management with Istio - Quiz 4medium Service Mesh - Service mesh vs library-based approach - Quiz 5medium