kube-router
kube-router copied to clipboard
Fix CLI Options - --master doesn't work without --kubeconfig
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:
- Launch kube-router with
--masterbut no--kubeconfigfile