Configuring ports in Kubernetes

So far in this chapter, we have created our own Kubernetes cluster and deployed our geolocation microservice on the cluster. But unfortunately, we were not able to access our microservice because we haven't exposed our ports (in the dashboard method) or created services (in the kubectl method). In this recipe, we will learn how to map our ports and create services.

Getting ready

When we deploy our application from the friendly form in the Kubernetes dashboard, we have some advanced settings that we could utilize to expose ports. Open the dashboard using the minikube command:

minikube dashboard

Delete any deployments, replication controllers, or services you already have for geolocation. You can leave the echoserver ...

Get Microservices Deployment Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.