Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set kubernetes context from tiltfile #5266

Open
nicks opened this issue Dec 9, 2021 · 3 comments
Open

set kubernetes context from tiltfile #5266

nicks opened this issue Dec 9, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@nicks
Copy link
Member

nicks commented Dec 9, 2021

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:
#1113 (Set the default namespace you're deploying to)
#2123 (reload the kubeconfig when the context changes)
#3791 (set up the kubeconfig during tiltfile initialization)
#3066 (don't connect to kubernetes until you need it)

@nicks nicks added the enhancement New feature or request label Dec 9, 2021
@milas milas self-assigned this Dec 14, 2021
@nzagorsky
Copy link

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.

@cmoulliard
Copy link

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.

@nicks
Copy link
Member Author

nicks commented Feb 25, 2022

@cmoulliard if you set the KUBECONFIG env variable, I believe tilt will respect that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants