expose Kubernetes cluster service

Jackie
1 min readApr 7, 2020

--

expose the deployment, pod, or replicateset using the expose command

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

otherwise, if 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, you can get the URL as:

minikube service –url the-new-service

--

--

No responses yet