Created
August 16, 2017 18:08
-
-
Save richarddli/09ddf0c603f1e0a5b30047652aabe303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Developing and debugging services on Kubernetes | |
A typical Kubernetes application consists of multiple, separate services ("aka microservices"). A service may depend on multiple other services in order to function correctly. For example, a "shopping cart" service might depend on a "product" service and a "user service". | |
In this multi-service architecture, development and debugging a single service can be complicated. Typically, your options are: | |
* run all of your services locally (requires lots of setup/maintenance) | |
* run all your services in a remote Kubernetes cluster (requires a CI pipeline to make updates and makes debugging cumbersome) | |
## A different way | |
Neither of these options are great for developers. [Telepresence](https://www.telepresence.io), a free, open source tool, provides an alternative approach. Telepresence lets you run a single service locally, while connecting that service to a remote Kubernetes cluster. With Telepresence: | |
* your service can connect to other services in the remote cluster | |
* other services can connect to your service | |
* your service has full access to Kubernetes environment variables, secrets, and ConfigMap | |
## How it works | |
Telepresence deploys a two-way network proxy in a pod running in your Kubernetes cluster. This pod proxies data from your Kubernetes environment (e.g., TCP connections, environment variables, volumes) to the local process. The local process has its networking transparently overridden so that DNS calls and TCP connections are routed over the proxy to the remote Kubernetes cluster. | |
## Further reading | |
The Google Cloud Platform community has a [tutorial on using Telepresence with Google Container Engine](https://cloud.google.com/community/tutorials/developing-services-with-k8s). The Telepresence website also has a [quick primer](https://www.telepresence.io/tutorials/kubernetes). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment