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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.