DEV Community

Maxime Guilbert
Maxime Guilbert

Posted on • Edited on

How to define a proxy in our kubeconfig file?

In some situations, we should need to use a proxy to do some calls on a Kubernetes cluster. But how can we define it in our kubeconfig file ?

Solution

In the parameter clusters[].cluster, you just have to add the parameter proxy-url with a value which uses the following template.

http://user:password@proxy:port

Exemple



apiVersion: v1
kind: Config
clusters:
- name: "dev"
  cluster:
    proxy-url: http://user:password@proxy:port
    server: "https://10.100.12.12:9006/k8s/clusters/c-jm5ws"
    ...


Enter fullscreen mode Exit fullscreen mode

Once updated and saved, you should be able to use your proxy and do some successful calls on your cluster!


Links

I hope it will help you! 🍺


You want to support me?

Buy Me A Coffee

Top comments (0)