Debug Kubernetes-Based Services with Datawire’s Telepresence

The Kubernetes open source container orchestration engine may super easy to get running, but customization has been a bear. There’s virtually no guidance for any customization, which is what all businesses want to do, said Richard Li, co-founder of Datawire.
Telepresence, an open source tool released earlier this year from Datawire, is focused on making the use of Kubernetes easier for developers, Li explained. When the team at Datawire started building cloud apps on Kubernetes, they found a lot of pain from a developer point of view. So it’s developed products to help alleviate some of this pain. The open source projects are Forge, which Li described as Docker Compose for Kubernetes; Ambassador, which is an API gateway built on Envoy, and now Telepresence.

Richard Li, Chief Yak Shaver at Datawire
Li said that the product, first released on Pi day (3/14/17), has been quietly gathering a following. It’s no wonder. The product allows you to test code running on a Kubernetes cluster, in real time using your current debugger, as if it were on the local host.
“We ourselves wanted a tool where you could make code changes and test immediately,” he said. After extensive searches for a tool turned up nothing, they decided to write their own.
But what has driven its popularity is the ability to connect any debugger to Kubernetes. “If you’re a developer it lets you work instantly,” said Li. “When you make a code change, you can see it immediately.”
Or, as Michael Hausenblas, developer advocate at Red Hat wrote on the OpenShift blog where he lays out the steps to get the product up and running, “Telepresence lets you proxy a local process running on your laptop to a Kubernetes cluster, both Minishift/Minikube as well as remote clusters. Your local process will have transparent access to the live environment: Networking, environment variables, and volumes. Plus, network traffic from the cluster will be routed to your local process.”
Developer tools company Stacktical has adopted the Telepresence into its own product line. “Tools like Telepresence makes it easy to contribute to existing, Kubernetes-powered projects and re-imagine how we collaborate around shipping code faster than ever before,” a company blog post stated. “It’s not just a matter of shipping scalable services. It’s a matter of improving the scalability of your team as well.”
The Stackitcal blog walks the reader through the setup. First, installing Telepresence is as simple as running the install commands.
12 brew cask install osxfusebrew install datawire/blackbird/telepresence
(NOTE: This code might be a bit different for your OS, though the installation instructions are well documented.) Once installed, pull up info on your Kubernetes services:
1 kubectl get service frontend backend db
This allows you to communicate to backend on the 8888 port from your local front-end.
The telepresence –swap-deployment command allows your local machine to transparently communicate with the Kubernetes staging cluster for the duration of your session with minimal effort:
1 telepresence --swap-deployment frontend --expose 8080:80 --run-shell
“Whenever we call the remote backend service, it’ll answer back to our local frontend application,” the Stacktical website asserts. “This two-way proxying system is at the foundation of the very ability of Telepresence to letting you replace any microservice in your architecture with its local counterpart.”
Datawire will be at KubeCon in Austin this December, offering a lightning talk on how to get Telepresence running on your computer, as well as a full session on the development flow in Kubernetes.