Accessing a web application running inside a pod

Hi, I am a beginner in kubernetes. I am taking the kubernetes for beginners course. In the services section, I have created a services.yml file and the service is created in kubernetes using the kubectl create -f service.yml command. But I am not able to access the web application in the pod. I am working on kubernetes playground by kataconda. How to find the node IP in the kubernetes playground .
Also in the demo video of the services section how did you find the IP of the node running the pod.

to check the k8s nodes details command is kubectl get nodes

The node port according to my services.yml file is 30008. I am not able to figure out the IP address to use to access my application. How to find the public IP of the nod running the pod.

Hi, the kubectl get nodes -o wide command shows the internal IP of the node and in the external IP column it is showing none

but you don’t need to access from your nodes ip addr. You can access from host ip addr:port of 30008.
Nodes ip is for internal communication. Host ip addr to access applications.

but you can by curl command if don’t want to access with host ip addr.
curl http://node-ip-addr:port

Okay, thank you for your reply. Can you tell me how to find the host ip? For instance I have created a pod using the nginx image. I have created a service with target port as 80 port as 80 and nodePort as 30008. How to find the host IP in order to access the nginx server. Please excuse me if it is a silly question , I have just started learning the basic concepts. Thanks in advance.

but your are working in katacoda right? and in master node?
no issue because i am also learning k8s.
your cluster setup on minikube?

Yes, I am working on the kubernetes playground by katacoda. I am not able to work on minikube as my laptop hangs every time I try to set up a single node cluster using minikube.

try this one minikube service <your-service-name>

But that is for minikube right? I am working on katacoda.

I knew you are working on kataconda but you deployed your cluster with help of minikube. and their you will get a private ip that is not accessible in your browser but you can check your web application deployed successfully or not by curl command as i mentioned earlier.
Try this steps :----
then click on + sign on top where we choose open new terminal option.
choose select port on view host 1
enter your 30008 port there
and you can access your web application there

1 Like

Yes got it! Thank you ! :slight_smile: