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

Feature request: Zarf dev package templating #2631

Closed
zack-is-cool opened this issue Jun 17, 2024 · 4 comments
Closed

Feature request: Zarf dev package templating #2631

zack-is-cool opened this issue Jun 17, 2024 · 4 comments
Labels
enhancement ✨ New feature or request

Comments

@zack-is-cool
Copy link
Contributor

Is your feature request related to a problem? Please describe.

It would be beneficial if zarf had the ability to template out what would be in a package at create time and also at deploy time with input variables. It is sometimes difficult to determine what will happen with a complex zarf package with component imports, overrides etc.

Describe the solution you'd like

  • Given I'm creating a zarf package
  • When I type zarf dev package template create (or something like this) with --set variables or referencing a zarf.config
  • Then Zarf will
    • template and print the Zarf package with templated ###ZARF_PKG_TMPLs rendered
    • template and print the values.yaml files with ###ZARF_VARs- defaults used if none provided by the user at create time
    • template and print all manifests that the helm charts would create with ###ZARF_VARs - defaults used if none provided by the user at create time
  • When I type zarf dev package template deploy (or something like this) with --set variables or referencing a zarf.config
  • Then Zarf will
    • template and print the Zarf package with templated ###ZARF_PKG_TMPLs rendered
    • template and print the values.yaml files with ###ZARF_VARs- possibly defaults used
    • template and print all manifests that the helm charts would create with ###ZARF_VARs - possibly defaults used if none provided by the user at deploy time

Additional context

I feel like this workflow eases the friction of needing to actually have a kubernetes cluster up and running and allows you to debug zarf package templating logic before applying anything to a cluster - similar to the way helm template works, but with the additional zarf templating on top of it.. This makes the feedback loop smaller when debugging a zarf package that is failing to deploy.

@zack-is-cool zack-is-cool added the enhancement ✨ New feature or request label Jun 17, 2024
@JoeHCQ1
Copy link

JoeHCQ1 commented Jul 3, 2024

I'll second this feature request. Not having an easy way to see the rendered yaml also made diagnosing this bug a bit tricky: #2692

Note that if the problem is in the values.yaml and it makes the yaml invalid, then a ctrl-c mid attempt to make it work will preserve the rendered yaml in your /tmp directory and you can view it there.

This command is also said to result in the full manifests because 'kind' is in all manifests:

zarf dev find-images . --flavor upstream --why "kind" > templated.txt

Final note: this zarf functionality should also be expanded into UDS since UDS is frequently the entrypoint to the package creation and deployment commands.

@salaxander salaxander added this to Zarf Jul 22, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Zarf Jul 22, 2024
@salaxander salaxander removed the status in Zarf Jul 22, 2024
@salaxander salaxander moved this to Triage in Zarf Sep 10, 2024
@MiraDSaan
Copy link

An example of this with helm is

helm template --debug chart/

which will output the templates with the variables filled in. Zarf should have a similar option.

@AustinAbro321
Copy link
Contributor

Thank you for this issue, it was part of the inspiration for https://github.com/zarf-dev/proposals/blob/main/0008-rework-inspect/README.md, which was recently approved and will be implemented

@AustinAbro321
Copy link
Contributor

Closing this, will update with the issues that come out of https://github.com/zarf-dev/proposals/blob/main/0008-rework-inspect/README.md.

@github-project-automation github-project-automation bot moved this from Triage to Done in Zarf Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
Status: Done
Development

No branches or pull requests

4 participants