We now have the foundation in place to deploy microservices, which are instrumented with X-Ray SDKs, to the EKS cluster.
In this step, we are going to deploy example front-end and back-end microservices to the cluster. The example services are already instrumented using the X-Ray SDK for Go. Currently, X-Ray has SDKs for Go, Python, Node.js, Ruby, .NET and Java.
kubectl apply -f https://eksworkshop.com/x-ray/sample-front.files/x-ray-sample-front-k8s.yml
kubectl apply -f https://eksworkshop.com/x-ray/sample-back.files/x-ray-sample-back-k8s.yml
To review the status of the deployments, you can run:
kubectl describe deployments x-ray-sample-front-k8s x-ray-sample-back-k8s
For the status of the services, run the following command:
kubectl describe services x-ray-sample-front-k8s x-ray-sample-back-k8s
Once the front-end service is deployed, run the following command to get the Elastic Load Balancer (ELB) endpoint and open it in a browser.
kubectl get service x-ray-sample-front-k8s -o wide
After your ELB is deployed and available, open up the endpoint returned by the previous command in your browser and allow it to remain open. The front-end application makes a new request to the /api endpoint once per second, which in turn calls the back-end service. The JSON document displayed in the browser is the result of the request made to the back-end service.
This service was configured with a LoadBalancer so, an AWS Elastic Load Balancer (ELB) is launched by Kubernetes for the service. The EXTERNAL-IP column contains a value that ends with “elb.amazonaws.com” - the full value is the DNS address.
When the front-end service is first deployed, it can take up to several minutes for the ELB to be created and DNS updated.