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
container that we created earlier or delete it-it shouldn't really affect us.
How to do it...
Go ahead and create a new application. Enter the application name
geolocation
and container imagevikrammurugesan/geolocation:latest
. This time, configure...