Transparently proxying to nodeport in kubernetes
If anyone is interested, I found trying to use a node port too difficult, and instead opted to just move transocks to its own pod and use host networking, along with the above forwarding rules to make this work. Here is the manifest I used for the transocks pod:
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "transocks"
},
"spec": {
"hostNetwork": true,
"dnsPolicy": "ClusterFirstWithHostNet",
"containers": [
{
"name": "transocks",
"image": "jusschwa/transocks-proxy"
}
]
}
}
This is the transocks toml I am using:
listen = "0.0.0.0:12345"
# Connect to HTTP Proxy
proxy_url = "http://127.0.0.1:30128"
[log]
level = "error"
30128 is the nodeport for the squid proxy.