Spending several hours to get all resources patched with .metadata.labels
using kustomize as helm post-render tool; Sometimes, the command kustomize removed an old subcommand (build)..sometimes, the command kustomize requires external plugins...etc
At the end, things works simply with a single yq
command:
yq '. *= load("patch.yaml")' all.yaml
Shipping that single command inside postrender
script, then use it with helm: helm template -g ./my-chart --post-renderer ./postrender
yq is a portable CLI with 0 dependencies. That's why i like it against kustomize in this use case.
Find full example in this github repo
Top comments (1)
Heyo!
This is an awesome post! 🔥 In fact, the topic of your post would also work really well in The Ops Community too!
The Ops Community is a place for cloud engineers to share tips & tricks, tutorials, and career insights. Folks there commonly share information about DevOps and SecOps topics amongst other things.
Would you consider posting this article there too? Because The Ops Community is built on the same platform as DEV (Forem) you can fairly easily copy the Markdown and post your article there as well.
Really hope that you'll share your post with the community there and consider browsing the other Forem communities out there!