~/ nmadiraju.com Amazon EKS · Labels, selectors and namespaces
arrow_back Back to nmadiraju
Visual Walkthrough · Kubernetes fundamentals

How Labels, Selectors and Namespaces Work on Amazon EKS

Follow a Service as it finds its Pods, loses them to one wrong letter, and meets a second namespace, then check yourself with 8 questions.

1Visual Walkthrough

Two namespaces, with a Service selecting Pods by label and traffic crossing the namespace line Left, namespace team-a with a Service web, three web Pods, a worker Pod and a database Pod. Right, namespace team-b with its own Service web and a checkout Pod. The walkthrough shows a selector matching labels, a case typo leaving the Service with no endpoints, DNS across namespaces, cross-namespace traffic allowed until a NetworkPolicy blocks it, and RBAC limited to one namespace. You kubectl · team-a dev NAMESPACE team-a Service web selector: app=web endpoints: 3 Pod web-1 app=web tier=frontend Pod web-2 app=web tier=frontend Pod web-3 app=web tier=frontend Pod worker app=worker not selected Pod postgres app=db port 5432 NetworkPolicy ingress: same namespace other incoming traffic denied Role pod-editor + RoleBinding, in team-a you: get, list, update pods applies only inside namespace team-a NAMESPACE team-b Service web selector: app=web a different web, same name Pod web-1 app=web team-b's web Pod checkout app=checkout calls other services

    request or your command selector matching labels namespace object in the API Pod

    Press Play to watch all nine steps, or step through with Back and Next. Red step tabs are where something breaks; green ones add the fix. Voice reads each step aloud with your browser's built-in speech.

    2Quiz to check understanding

    Check yourself