Many organizations adopt cloud native development practices with the goal of shipping features faster. The technologies and architectures may change when we move to the cloud, but the fact remains that we all still add the occasional bug to our code.
The challenge here is that many of your existing local debugging tools and practices can’t be used when everything is running in a container or deployed onto Kubernetes running in the cloud. This is where the open source Telepresence tool can help.
Join Daniel to learn about:
- Quick overview of remote-local ("remocal") options and tooling e.g. “kubectl port-forward”, Skaffold, ksync, Telepresence etc.
- An exploration of how Telepresence can “intercept” or reroute traffic from a specified service in a remote K8s cluster to your local dev machine
-- The benefits of getting a “hot reload” fast feedback loop between applications being developed locally and apps running in the remote environment
2. @danielbryantuk
tl;dr
2
• The inner development loop can be painful with microservices & Kubernetes
• Telepresence “proxies” your local machine into the cluster, increasing fast feedback
• Telepresence enables remote-to-local “remocal” development
• Telepresence supports several workflows to make you more productive
• Please support this CNCF project — get involved!
5. @danielbryantuk
Inner and outer dev loops
5
Hat tip to Mitch Denny (now 404): https://mitchdenny.com/the-inner-loop/
http://jorgemoral.es/posts/2020_03_17-develop_apps…
10. @danielbryantuk
Inner and outer dev loops with K8s
can be the same
10
• Write code
• Build container
• Push to registry
• Deploy to cluster
• Test
And can be …. SLOW.
16. @danielbryantuk
What is Telepresence
16
• “Fancy Kubernetes VPN for development”
• “kubectl port-forward on steroids”
• “kubectl proxy all-the-things”
• A network bridge between your laptop and the Kubernetes cluster
20. @danielbryantuk
Telepresence: Local-to-Remote bridge
20
telepresence connect
• Open a tunnel to the remote cluster; exposes “in-cluster” services/network/DNS
telepresence intercept my-service —port 3000
• Re-routes (intercepts) tra
ff
ic to my-service in the remote cluster to my local machine
telepresence login & telepresence intercept
• Create preview URL to isolate and share results of the intercept
21. @danielbryantuk
Telepresence: Local-to-Remote bridge
$ telepresence intercept dataprocessingnodeservice --port 3000
21
Using deployment dataprocessingnodeservice
intercepted
State : ACTIVE
Destination : 127.0.0.1:3000
Intercepting: HTTP requests that match all of:
header("x-telepresence-intercept-id") ~= regexp ("76a1e848-1829-74x-1138-e3294c1e9119:dataprocessingnodeservice")
Preview URL : https://[random-subdomain].preview.edgestack.me
www.youtube.com/watch?v=W_a3aErN3NU
25. The Good, the Bad, and the
“Don’t Try this at Home”
25
26. @danielbryantuk
Benefits
26
• Use any tool that runs on your laptop: IDE, profiler, debugger, …
• Connect to cloud-based resources
• Same network namespace (e.g., curl and ping work)
• Very fast inner loop!
27. @danielbryantuk
Requirements
27
• Network connection
• kubectl access to cluster
• Supports all modern OSs: Mac, Linux, or Windows Native/WSL2
• A cooperative VPN!
https://blog.getambassador.io/implementing-telepresence-networking-with-a-tun-device-a23a786d51e9
29. @danielbryantuk
tl;dr
29
• Capturing DNS and routing selectively to the
cluster is tricky
• Maintaining proxy connections can be
challenging
• Kubernetes has many resource types
• No two laptops are alike
• No two clusters are alike
• And more
32. @danielbryantuk
Conclusion
32
• The inner development loop can be painful with microservices & Kubernetes
• Telepresence “proxies” your local machine into the cluster, increasing fast feedback
• Telepresence enables remote-to-local “remocal” development
• Telepresence supports several workflows to make you more productive
• Please support this CNCF project — get involved!
34. @danielbryantuk
Contributing to Telepresence
34
• Documentation and workflows
• Explain how you integrate Telepresence into your development workflow
• Let us know if you’re a user!
• Triage
• Lots of folks use GitHub for support, which doesn’t scale well
• Join Slack to help other users https://a8r.io/slack #telepresence