简体   繁体   English

从 kubernetes pod 到本地容器的端口转发

[英]Port forward from kubernetes pod to local container

I need to connect a service running in a local container inside Docker on my machine to a database that's running on a Kubernetes cluster.我需要将在我的机器上 Docker 内的本地容器中运行的服务连接到在 Kubernetes 集群上运行的数据库。

Everything I found on port forwarding allowed me to connect my machine to the cluster, but not the local container to the cluster (unless I install kubectl on my container, which I cannot do).我在端口转发上找到的所有内容都允许我将我的机器连接到集群,但不能将本地容器连接到集群(除非我在我的容器上安装了 kubectl,这是我做不到的)。

Is there a way to do this?有没有办法做到这一点?

https://www.telepresence.io/ is what you're looking for. https://www.telepresence.io/是您正在寻找的。 It will hook into the cluster network like a VPN and patch the services so traffic will get routed through the tunnel.它将像 VPN 一样连接到集群网络并修补服务,因此流量将通过隧道路由。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM