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,250 points
70 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 http://192.168.99.100:32382/ - 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,200 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,000 points
13 views
0 votes
1 answer
0 votes
2 answers

Access Kubernetes api from within a pod container

wget version: KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) wget -vO- ...READ MORE

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

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 35,750 points
30 views
0 votes
1 answer
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
458 views
+3 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.