7.1.2 Creating an internal service
View in the book.
Buy the book.
Let’s deploy a Robot avatar creation service to use as the internal service.
The Deployment and Service look like so:
$ cd Chapter07/7.1_InternalServices/
$ kubectl create -f robohash-deploy.yaml
deployment.apps/robohash created
$ kubectl create -f robohash-service.yaml
service/robohash-internal created
Wait for the Pods to become ready
kubectl get pods -w
Then try it out locally
kubectl port-forward service/robohash-internal 8080:80
Append a string to the URL like /william
to generate a random robot
Example Robot (robot parts designed by Zikri Kader, assembled by Robohash.org, and licensed under CC-BY)
Next, we’ll use service discovery to use this internal service in our app.