tilt
tilt copied to clipboard
set kubernetes context from tiltfile
Describe the Feature You Want
Your tiltfile should be able to specify which kubernetes context to switch to.
e.g.,
k8s_context('minikube')
If you edit the k8s_context call in the tiltfile during a tilt session, tilt should disconnect from that cluster and re-connect to the new one.
Why Do You Want This?
This would be a genuinely useful feature on its own! But we also expect this to be a prerequisite for a number of other cluster-management features, like
- onboarding flows that help you setup a cluster
- diagnosing a broken cluster
- resetting a cluster
Additional context
Here are some related issues that get at the same thing: https://github.com/tilt-dev/tilt/issues/1113 (Set the default namespace you're deploying to) https://github.com/tilt-dev/tilt/issues/2123 (reload the kubeconfig when the context changes) https://github.com/tilt-dev/tilt/issues/3791 (set up the kubeconfig during tiltfile initialization) https://github.com/tilt-dev/tilt/issues/3066 (don't connect to kubernetes until you need it)
Up for this. That might help to have multiple tilt instances running at once (on top of TILT_PORT env var). Some flexibility here would be greatly appreciated.
We should have the possibility to pass the config yaml file as we can do with kubectl with this parameter --kubeconfig='': Path to the kubeconfig file to use for CLI requests.
@cmoulliard if you set the KUBECONFIG env variable, I believe tilt will respect that