tilt icon indicating copy to clipboard operation
tilt copied to clipboard

New "inject kubeconfig into local env" breaks tilt setups with multiple clusters

Open dnephin opened this issue 1 month ago • 1 comments

Related to https://github.com/tilt-dev/tilt/pull/6619

Expected Behavior

Previously calls to local would use the default .kube/config that allowed commands run by local to access multiple clusters.

Current Behavior

As of v0.36.0 these commands fail with "context x does not exist".

Steps to Reproduce

To reproduce the error you'd need a full client that depends on multiple clusters. A minimal reproduction would be to check env to see if KUBECONFIG is set or not. It should be unset so that it uses the default kube config file.

Context

Could we get an option or some other way to disable this behaviour?

The current workaround I found was to use

env = {"KUBECONFIG": os.getenv("KUBECONFIG", "")}

That seems to work for now, but I'm not sure if it will continue to work in the future.

dnephin avatar Nov 18 '25 20:11 dnephin

Yep, this is working as designed - we got a lot of complaints where people edited their kubeconfig while running tilt, and we're surprised it changed the behavior of local().

We can add something to the documentation, that work around seems like a reasonable one

nicks avatar Nov 18 '25 22:11 nicks