tilt-dev / tilt-dev/tilt

Recommended solution for local scripts that generate Kubernetes YAML

Open
#3,046 2 comments 3 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

Raffo in the Tilt channel writes:

I have the following problem that I’m trying to figure out:
I have a local_resource (a shell script) that renders some kubernetes yamls according to some internal conventions.
I want to apply all of the yamls in the rendered folder
I want to use k8s_resource to apply/consider a specific resource only when some dependencies are ready (in kubernetes terms).
I’m using something like:

local_resource('render', cmd='./render.sh')
k8s_yaml(listdir("tmp/rendered", recursive=True))
k8s_resource('test', resource_deps=['foo'])

But this has some drawbacks about order of execution and dependency-tracking. You can also do this with a local() command but that also has some drawbacks (the Tiltfile can only be re-executed in one go, it's easy to accidentally hit infinite reload problems, etc.) Here are some bugs we're run into one trying to support this approach:

This seems like a common use-case. Wiring it together on your own seems hard to get right. Which makes me feel like all these bugs / feature-requests are indicative that the APIs aren't working together great

I think this all hints at a build primitive that generates other kubernetes resources, with the ability to list dependencies between them, but I'm not sure quite what it is yet - it might be simple. A way to resolve this ticket might just be a doc / working example on a recommended approach on how to do this

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 reviewing the examples in the issue and the related discussions in issues #2957 and #1930. Determine whether a documented workflow or a new build primitive is needed for rendering Kubernetes YAML while preserving resource dependencies. Done means the recommended approach is explicit and its execution and dependency behavior are validated.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.