kube-router icon indicating copy to clipboard operation
kube-router copied to clipboard

Fix CLI Options - --master doesn't work without --kubeconfig

Open aauren opened this issue 1 year ago • 0 comments

What happened?

A user attempting to only override the kube-apiserver address with --master would expect that it would pick up the credentials mounted into the pod via /run/secrets/.

What did you expect to happen?

The APIs that kube-router uses from client-go forces kube-router to get the config from an actual kubeconfig file and if the user only supplies --master it looks like kube-router will always fail to contact the kube-apiserver.

In this case, the only way that the user can override the kube-apiserver details, is to overload the ENV vars that kubernetes supplies and set KUBERNETES_SERVICE_HOST & KUBERNETES_SERVICE_PORT

How can we reproduce the behavior you experienced? Steps to reproduce the behavior:

  1. Launch kube-router with --master but no --kubeconfig file

aauren avatar Mar 03 '24 21:03 aauren