There are a lot of valid scenarios the developer would like to the cluster resources exposed so that it could be easily tested and debugged.

If there are no existing services available, it could be exposed using the kubectl command.

You can expose the deployment, pod, or replicate set using the command

kubectl expose replicasets.apps existing-rc –port=9000 –target-port=9000 –type=NodePort –name=testport

otherwise, in case you already have a service running, you can upgrade it

kubectl patch svc existing-service -p ‘{“spec”: {“type”: “NodePort”}}

Note, if you already have cluster IP, you can also use LoadBalancer.

after that, you should have the service with the necessary port information

if you are using minikube locally, then you can get the URL as:

minikube service –url the-new-service

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store