We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Unique IP Addresses

Every Pod in a Kubernetes cluster has a unique internal-to-k8s IP address. By giving each Pod a unique IP, Kubernetes simplifies communication and service discovery within the cluster. Pods within the same Node or across different Nodes can easily communicate.

All the resources inside a k8s cluster are virtualized. So, the IP address of a Pod is not the same as the IP address of the Node it's running on. It's a virtual IP address that is only accessible from within the cluster.

Assignment

Run this command to get a "wide" output of your pods:

kubectl get pods -o wide

It gives a few more columns of information, including the IP address of each Pod. Notice that each Pod has a unique IP address!

Next, run:

kubectl proxy

This will start a proxy server on your local machine, probably on 127.0.0.1:8001. Assuming that's the host, navigate to http://127.0.0.1:8001/api/v1/namespaces/default/pods in your browser. You should see a big nasty JSON blob that describes the pods that you have running.

Run and submit the CLI tests.

The tests will make sure that the proxy server is accessible and that it's returning information about the current Pods in your cluster.