Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support debug for Helm #2350

Closed
briandealwis opened this issue Jun 26, 2019 · 5 comments · Fixed by #4732
Closed

Support debug for Helm #2350

briandealwis opened this issue Jun 26, 2019 · 5 comments · Fixed by #4732
Assignees
Labels
area/debug deploy/helm kind/todo implementation task/epic for the skaffold team priority/p2 May take a couple of releases
Milestone

Comments

@briandealwis
Copy link
Member

Support debugging applications using Helm. Difficulties here are:

  • Helm charts use Go templating in all its glory: it's difficult to parse and manipulate, and can even result in loops to generate resource objects
  • Helm chart templates can be evaluated on both client- and server-side (by tiller)
  • Helm 3 is purely client-side

With Helm 3, our life is a bit easier as it seems to be entirely client-side templating. So we can treat it like our kustomize deployer.

Helm 2 is a bit more difficult. As I understand it, our current Helm deployer sends off the chart, and then applies changes (labels) to the deployed artifacts. One possibility is to use the same approach: pull down the deployed artifacts, transform, and then re-apply. There is a gap though where the un-transformed artifacts will be running.

Another approach would be to restrict debug to support client-side templating only. So we could attempt to first apply the Helm templates (helm template) and abort if further server-side template-application is required?

@briandealwis
Copy link
Member Author

briandealwis commented Jun 26, 2019

Issue around general Helm 3 support #2142

@balopat balopat added the kind/todo implementation task/epic for the skaffold team label Aug 14, 2019
@briandealwis briandealwis added the priority/p2 May take a couple of releases label Aug 21, 2019
@tstromberg
Copy link
Contributor

@briandealwis - do you have any progress to report on this?

@briandealwis
Copy link
Member Author

So Helm 3 adds a --post-renderer flag. From the description, it seems to support providing an executable (no arguments) to transform the manifests prior to being sent to the cluster. It provides the rendered k8s manifests on stdin, and expects the result in stdout.

Since this post-renderer executable cannot take any arguments, we could create a script on the fly to invoke skaffold. But it might be be easier to enhance Skaffold to support a special environment variable to pass along a command-line (SKAFFOLD_COMMAND_LINE?). This would then execute a new internal command, say debug-transform, to apply the debug transforms to the provided manifests. Or perhaps it might be more useful to extend render to support debug explicitly (skaffold render -f path/to/skaffold.yaml --debugging --manifests=-?).

debug currently uses the list of built image tags to decide which containers to affect. In this mode, perhaps we just attempt to transform all images. There was some discussion in #2184 about adding a debug --images=tag,... flag to only process certain images. We could use a similar mechanism to pass in the image list from the outer skaffold.

@jkleckner
Copy link

Limiting to client-side templating and helm3 is probably fine if this makes it simpler.

@amorabito
Copy link

Skaffold is great, this feature would be very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/debug deploy/helm kind/todo implementation task/epic for the skaffold team priority/p2 May take a couple of releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants