how to get Kubernetes Pods to use a transparent SOCKS5 proxy for certain connections?

3/30/2019

I have a Kubernetes cluster (Kubernetes 1.13, Weave Net CNI) that has no direct access to an internal company network. There is an authentication-free SOCKS5 proxy that can (only) be reached from the cluster, and which resolves and connects to resources in the internal network:

Consider some 3rd party Docker Images used on Pods that don't have any explicit proxy support, and just want a resolvable DNS name and target port to connect to a TCP-based service (which might be HTTP(S), but doesn't have to be).

What kind of setup would you propose to bind the Pods and Company Network Services together?

-- muffel
kubernetes

1 Answer

5/20/2019

The only two things comes to my mind are:

1) Run the Socks5 docker image as a sidecar: https://hub.docker.com/r/serjs/go-socks5-proxy/

2) Use Transparent Proxy Redirector on the nodes - https://github.com/darkk/redsocks

-- PjoterS
Source: StackOverflow