Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question

In kubernetes, if you have a container running in a pod, that exposes a web server through some port, since the pod only has an internal IP within the cluster and say you have no public IP for the pod using kubernetes "service" approach, how can you access the webserver? (answer contains two steps)

Answer

Through using "kubectl proxy", and then doing curl to the API endpoint of the pod

^^ note that "kubectl proxy" command creates a proxy process through which you can hit the endpoints of your cluster

^^^ note that "kubectl proxy" does not return any output and just keeps running in the shell till you ctrl-c/termintate it, so run it from a seperate terminal than your curl command

^^^^ the curl command would be something like: curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/ , where 8001 is port proxy is running on


Question

In kubernetes, if you have a container running in a pod, that exposes a web server through some port, since the pod only has an internal IP within the cluster and say you have no public IP for the pod using kubernetes "service" approach, how can you access the webserver? (answer contains two steps)

Answer
?

Question

In kubernetes, if you have a container running in a pod, that exposes a web server through some port, since the pod only has an internal IP within the cluster and say you have no public IP for the pod using kubernetes "service" approach, how can you access the webserver? (answer contains two steps)

Answer

Through using "kubectl proxy", and then doing curl to the API endpoint of the pod

^^ note that "kubectl proxy" command creates a proxy process through which you can hit the endpoints of your cluster

^^^ note that "kubectl proxy" does not return any output and just keeps running in the shell till you ctrl-c/termintate it, so run it from a seperate terminal than your curl command

^^^^ the curl command would be something like: curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/ , where 8001 is port proxy is running on


Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.