tilt-dev / tilt-dev/tilt

[Feature] Have `k8s_custom_deploy` output be the `stdout` of the apply command

Open
#6,477 0 comments 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

Describe the Feature You Want

Return the stdout from the apply command/bat of k8s_custom_deploy as the function output in Tiltfile.

Current Behavior

The k8s_custom_deploy function returns nothing.

Why Do You Want This?

I was previously using the local(...) + k8s_yaml(...) pattern to run timoni to deploy Kubernetes resources.

This was helpful because I could simultaneously parse out the output of local(...) and group resources the way I like in the Tilt WebUI using k8s_resource.

This however used the timoni build command that generates the YAML manifests (similar to helm template ... command).

timoni also allows us to apply resources in specific orders and with Kubernetes unit testing. This is a significant quality-of-life improvement over helm.

The issue is that if we use timoni to apply resources and use Tilt's k8s_custom_deploy function then we lose the ability to parse the YAML of the applied objects and pass that into k8s_resource function. There was no way that I could find to get the stdout from k8s_custom_deploy apply command.

Having k8s_custom_deploy output the apply command feels like the easiest fix around this problem. But am open to suggestions or workarounds.

Additional context
In case you try to reproduce this with timoni, note that timoni apply does not output YAML manifests as expected by Tilt's k8s_custom_deploy. It has its own console output format. So I used a wrapper script around timoni apply + timoni inspect resources when using in k8s_custom_deploy. This script is shown in https://github.com/stefanprodan/timoni/issues/454

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 at the k8s_custom_deploy entry point and trace how its apply command is executed and its result is returned to the Tiltfile. Compare the current empty function result with the command's stdout, then verify the output supports the reported Timoni wrapper use case without changing Kubernetes resource behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.