How to connect Pod in K8S cluster with local network for debugging

How to connect Pod in K8S cluster with local network for debugging

[[404039]]

Preface

As we all know, when there is no K8S cluster, we can directly connect to the test environment service to debug. With the arrival of K8S, we can no longer directly connect to the business service to debug. The IP address assigned to the K8S Pod is the internal network of the cluster, and the external network of the cluster cannot directly access the Pod. So what is a good solution to directly connect to the Pod? The following introduces open source Telepresence.

Introduction to Telepresence

Telepresence is an open source tool that allows you to run a single service locally while connecting that service to a remote Kubernetes cluster. This enables developers building multi-service applications to:

  • Do rapid local development on a single service, even if that service depends on other services in the cluster. Make changes to your service, save, and you can instantly see the new service running.
  • Use whatever tools you have installed locally to test/debug/edit your service. For example, you can use a debugger or an IDE!
  • Make your local development machine run as if it were part of a Kubernetes cluster. If you have an application on your machine that you want to run against a service in the cluster - this is easy to do.

Open source address: https://github.com/telepresenceio/telepresence

How Telepresence Works

Telepresence deploys a bidirectional 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 local processes. The local process's network is transparently overlaid so that DNS calls and TCP connections are routed through the proxy to the remote Kubernetes cluster.

This approach gives:

  • Your local services have full access to other services in the remote cluster
  • Full access to your local services for Kubernetes environments, secrets, and ConfigMaps
  • Your remote service has full access to your local service

Telepresence Supported Platforms

  • Mac OS X
  • Linux

Telepresence Installation

Can be installed using Homebrew, apt or dnf

Telepresence Usage Report

Telepresence collects some basic information about its users so that it can send important customer notifications, such as new version availability and security announcements. We also use this information to anonymously aggregate basic usage analytics. To disable this behavior, set the environment variable SCOUT_DISABLE:

  1. export SCOUT_DISABLE=1

How to use Telepresence

I won’t describe it here. For details, please refer to https://www.telepresence.io/tutorials/kubernetes

Reference Links

  • https://github.com/telepresenceio/telepresence
  • https://www.telepresence.io/discussion/overview

<<:  Airplanes are all equipped with 5G, so why is the signal on high-speed trains still so poor?

>>:  China's 6G network will be commercially available in 2030 to help realize the "intelligent connection of all things"

Recommend

5G is used to serve IoT, what will 6G be used for?

"5G is used to serve IoT (Internet of Things...

Can Huawei reshape the Internet?

[[320457]] This article is reproduced from Leipho...

5G means data center platforms must evolve

The foundation for seamless 5G implementation 5G ...

What is 10Gb Ethernet

Ethernet is a technology used to connect various ...

5G changes everything. 5G will have a huge impact on many areas of life

From low-latency, ultra-high-speed bandwidth to i...

SpaceX executive says Starlink can expand service to 30 million Americans

SpaceX's satellite internet service, Starlink...

Where will edge computing investments go?

At the beginning of 2020, edge computing seemed t...

The 10 coolest software-defined networking technologies of 2017

Software is driving the innovation engine of the ...

Mobile edge computing provides unlimited possibilities for 5G innovation

At the "2017 China MEC Industry Development ...