kubeswitch icon indicating copy to clipboard operation
kubeswitch copied to clipboard

Kubeswitch does not handle proxys

Open anton264 opened this issue 4 months ago • 3 comments

Kubeconfig can use the proxy-url to enable usage through a proxy. It would be convenient if I could set the proxy in the switch-config to talk to the api and also add the proxy-urlto the kubeconfig

anton264 avatar Mar 04 '24 06:03 anton264

Hi, to clarify: you want a proxy-server to be globally enabled via kubeswitch which is then put into all of the kubeconfig files?

danielfoehrKn avatar Apr 14 '24 01:04 danielfoehrKn

I think proxy should be able to be added to specific configs, if we take rancher as an example:

kind: SwitchConfig
version: v1alpha1
kubeconfigStores:
- kind: rancher
  id: rancher
  config:
    rancherAPIAddress: https://rancher.yourdomain.com/v3
    rancherToken: token-12abc:bmjlzslas......x4hv5ptc29wt4sfk
    proxy-url: my-proxy-url:1234
  cache:
    kind: filesystem
    config:
      path: ~/.kube/cache

As you can see I have added a proxy-url to the config. If a proxy has been set in the switch-config it should also be set in the kubeconfig-files in the ~/.kube/cache path.

anton264 avatar Apr 14 '24 05:04 anton264

Just a small correction above: the proxy-url is a kubeconfig config option, hence it should be either on the global or store-level for the SwitchConfig instead of the store-specific level.

kind: SwitchConfig
version: v1alpha1
kubeconfigStores:
- kind: rancher
  id: rancher
  proxy-url: my-proxy-url:1234

I think that should be doable, I'll work on a fix.

danielfoehrKn avatar Apr 17 '24 14:04 danielfoehrKn