Bruno Schaatsbergen website Mastodon PGP Key email A drawing of an astronaut in space The Netherlands

Proxying Terraform Traffic to a Private Kubernetes Cluster

in
writing
date
10/9/2024

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.

/proxying-terraform-traffic-to-a-private-kubernetes-cluster