How can I access a service installed on Kubernetes from anywhere?

0 votes

I am trying to configure kubernetes and I have a mac machine and installed the latest Kubernetes and followed the example here. All went smooth but I was hoping that Kubernetes will provide me an ip address and port number where my service will be listening to so that I can access it from anywhere.

Please correct me if I am wrong.

I was able to run ifconfig as well as curl $(minikube service hello-minikube --url) and I was able to see the ip address and port but I wasn’t able to access it outside command line where Kubernetes lives in.

The reason I am trying to access it outside the VM is because we have other projects that run on other machines and I wanted to call the REST service I installed while we are on dev env. This way we don’t have to wait until the service is pushed to production.

Can anyone help me with this ?

Jul 23, 2018 in Kubernetes by Damon Salvatore
• 5,490 points

1 answer to this question.

0 votes

I have followed the link which you have attached and it works as expected.

Here is a command which you can use:

minikube service hello-minikube --url

You will get a url like - the port and IP could and will change for you. Also note that the exposed port will be a random port like the 32382 and not 8080 that the pod uses.

Use the url in your browser, say and you should be able to see the output of the service.

I hope the information would be helpful for you.

answered Jul 23, 2018 by Atul
• 10,240 points

Related Questions In Kubernetes

0 votes
1 answer

How can I stop a replicaset from restarting after deleting?

You need to delete the corresponding deployment. ...READ MORE

answered Dec 31, 2018 in Kubernetes by ajs3033
• 7,240 points
0 votes
1 answer

How can i get all the pods on a node?

You can use the following command to ...READ MORE

answered 5 days ago in Kubernetes by Sirajul
• 5,160 points
0 votes
1 answer
0 votes
2 answers

Access Kubernetes api from within a pod container

wget version: KUBE_TOKEN=$(</var/run/secrets/ wget -vO- ...READ MORE

answered Aug 29, 2018 in Kubernetes by Nilesh
• 6,900 points
0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address= option to the line  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 37,320 points
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
+3 votes
1 answer