Proxying Terraform Traffic to a Private Kubernetes Cluster
The SOCKS5 protocol allows TCP traffic forwarding, making it perfect for tunneling connections. Both the Kubernetes and Helm Terraform providers support TCP traffic forwarding, enabling you to route requests to your private cluster.
To configure Terraform to use a local tunnel to the SOCKS5 proxy server, set the proxy_url
argument in the provider block.
provider "kubernetes" {
...
proxy_url = "socks5://127.0.0.1:8888"
...
}
By specifying the proxy_url
, the Kubernetes provider forwards all requests through the SOCKS5 proxy to the Kubernetes API.