--kube-context is not used
nikolajbrinch opened this issue · 5 comments
Great plugin!
It seems though that --kube-context to helm tiller does not have an effect. It uses the current-context, so it will deploy in current-context even though --kube-context is different, or if current-context is blank, will terminate with an error.
--kube-context
is for helm cli
The issue is that Tiller uses the default configuration for the kubernetes client and it defaults to current-context. It's designed to be run inside the same cluster your are deploying to which is probably why they didn't add a flag for context.
I don't think there's a workaround except for changing the current context which is a bit annoying. I believe you'd have to add an option to tiller to make this work.
See here for client creation: https://github.com/helm/helm/blob/master/cmd/tiller/tiller.go#L150
And here for defaults: https://github.com/kubernetes/cli-runtime/blob/a04da5c88c0796c1dc5ff976a9c91999779ac0e4/pkg/genericclioptions/config_flags.go#L288
The workaround is to open new shell and use export KUBECONFIG=
+ change the context.
I'm not sure I understand how that's a workaround. I want to use my same kubeconfig file and current context, but deploy using a different context.
@asetty I think I can tell you why it's so hard and KUBECONFIG
is the best possible workaround that worth the effort. PTAL my comment in the context of an another helm-related tool roboll/helmfile#642 (comment)