Debugging a single service with Telepresence
#
Debug AreaIn the debug area you will see the list of all the microservices developed with the Developer Console.
At the first level you have the necessary information to understand the health of the service: whether it is active or not, and the memory levels used.
Although the real potential of the debug area is its connection with telepresence. Pressing the "Debug" button will in fact display a string to be pasted on your terminal that simulates the behavior of your microservice in a real context.
This will allow you to easily test and debug your micro-service without compromising the production environments
#
Introduction to TelepresenceTelepresence is an open source tool that lets you run a single service locally, while connecting that service to a remote Kubernetes cluster. This lets developers working on multi-service applications to:
Do fast local development of a single service, even if that service depends on other services in your cluster. Make a change to your service, save, and you can immediately see the new service in action.
Use any tool installed locally to test/debug/edit your service. For example, you can use a debugger or IDE!
Make your local development machine operate as if it's part of your Kubernetes cluster. If you've got an application on your machine that you want to run against a service in the cluster -- it's easy to do.
Telepresence works on both Mac OS X and Linux, with OS-native packages.
#
Installing Telepresence#
OS XOn OS X you can install Telepresence by running the following:
#
Ubuntu 16.04 or laterRun the following to install Telepresence:
If you are running another Debian-based distribution that has Python 3.5 installable as python3, you may be able to use the Ubuntu 16.04 (Xenial) packages. The following works on Linux Mint 18.2 (Sonya) and Debian 9 (Stretch) by forcing the PackageCloud installer to access Xenial packages.
#
Connect to a Kubernetes Cluster and start debugging the microserviceLet's take an example on a test cluster
#
1. Connect to your clusterinfo
If you don't have yet installed Google Cloud follow the steps at this link