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

Accident review: We duplicated the order ID!

[[428490]] introduce In many business systems, we...

What you need to do to prevent data center downtime

Recently, according to a survey report on data ce...

AlphaVPS: 128GB-2TB large hard disk VPS annual payment starts from 15 euros

AlphaVPS is a Bulgarian hosting company registere...

Six predictions for the 5G market in 2020

2019 is the first year of 5G worldwide. More than...

Zhao Rong wishes you a happy new year! Hongtu Exhibition!

The tiger is gone and the rabbit is here, everyth...

Hang Seng Bank launches new generation digital financial infrastructure LIGHT

On October 24, the 2020 Hang Seng LIGHT Developer...

Google's OnHub routers will stop supporting software in December next year

Google announced today that it will stop software...

What exactly are the CE, C++, and C+L bands?

[[400269]] This article is reprinted from the WeC...

How can the CDN industry break through the era of negative gross profit?

Since the Ministry of Industry and Information Te...

Example: How to plan IP addresses for a large-scale monitoring network system?

For monitoring projects, many faults are caused b...

Why is the world crazy about blockchain? Because of a "wealth code"

In 450 BC, Nehemiah, an official of the Persian E...

Unexpectedly, China Unicom is the biggest loser in number portability

It is said that China Mobile has announced that t...