tilt-dev / tilt-dev/tilt

Defer validation of Kubernetes environment until a resource effectively needs it

Open
#3,791 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

We'd like to integrate the bootstrapping of our Minikube cluster to Tilt using local_resource

This is helpful because we can dynamically determine how cpu/memory to use based on which resources need to be deployed, and also because currently, our way to setup a local development environment is finnicky (i.e. wait until this service is up, then port-forward it to :XXXX, then run this JAR to register the IoT device on the cluster...) and we'd like to make that into a single tilt up command, especially given that "waiting for service X to be up" is the kind of thing that is finnicky to script, but that Tilt is great at.

Currently, however, when you tilt up before Kubernetes is up, you'll run into some variation of these errors:

Error: Error watching k8s events
: could not set up k8s client: Kubernetes context not set in [/home/ubuntu/.kube/config]

Error: Error watching services. Are you connected to kubernetes?
Try running `kubectl get services`: could not set up k8s client: Kubernetes context not set in
[/home/ubuntu/.kube/config]

This will happen even though we have a local_resource that will spin up a minikube instance, and if this check was deferred by default (or by some top-level setting like deferred_kubeconfig(True)) this could be naturally implemented and would work as intended

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported tilt up behavior before Kubernetes is available, using a local_resource that starts Minikube. Trace where Kubernetes validation occurs relative to resources that need it, then define and test the requested deferred behavior or top-level setting so startup does not fail until a resource effectively requires Kubernetes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.