Giter VIP home page Giter VIP logo

Comments (5)

nicks avatar nicks commented on June 14, 2024

hmmmmm....i was not able to reproduce the behavior you're describing. But I think there's a bit of confusion about the expected behavior. Here's what I tried:

The behavior I would expect is that Tilt reads the kubeconfig at startup, and continues to deploy to the same cluster, even if your current context changes.

Do you have additional repro steps?

from tilt.

PeterStolz avatar PeterStolz commented on June 14, 2024

Unfortunately after playing around a bunch I also can't reproduce the bug.
To fill in some additional defails.

  1. Starting tilt with the remote cluster as context yields the expected error due to beeing potentially on production.
    -> I could not have started tilt by accident on the affected cluster as it would not have applied anything. I am certain the allowed context is and was docker-desktop as I did not change that at all. Also docker-desktop is the local cluster and not some sadistic rename.
  2. This happened after my laptop was suspended for around 14 hours.
  3. Parts of tilt were likely building a container and a local helm chart was likely reinstalled, because the affected file was not in the .helmignore or .dockerignore

To me this feels like a very weird race condition. I am not familiar with the codebase, but do you know how tilt handles the context internally? Are kubectl commands always applied with a pinned context?
At some point tilt must have switched the context even skipping the k8s_context validation.

from tilt.

PeterStolz avatar PeterStolz commented on June 14, 2024

Is tilt maybe working with tokens to authenticate to the api and because >14h passed, it expired and it had to renew it bypassing the checks and using the current-context?

from tilt.

nicks avatar nicks commented on June 14, 2024

tilt reads the kubeconfig at startup, minifies it (removing all the other kube contexts), writes a new minified kubeconfig to a different place on disk, and uses that one for all future connection settings. If you run tilt get cluster -o yaml, you can see what it's using.

from tilt.

PeterStolz avatar PeterStolz commented on June 14, 2024

The config it writes to:
tilt get cluster -ojsonpath='{.items[*].status.connection.kubernetes.configPath}'
is not used by tilt itself? When deleting it tilt still works.
There is a config at ~/.tilt-dev though and even deleting that does not prevent tilt from talking to the cluster. There has to be some in memory state.
Shooting in the dark here, but the long time between the tilt updates and communication with the apiserver is probably key to this. Maybe there is some broken error handling when reestablishing a connection?

from tilt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.