arttor / helmify

Creates Helm chart from Kubernetes yaml
MIT License
1.48k stars 136 forks source link

Keep original manifest filename, support list of files #100

Closed ComeBurguburu closed 1 year ago

ComeBurguburu commented 1 year ago

Hi, I want to use helmify on many files and keeping original name and mutualise values.yaml

Here is how I run it with bash

rm -rf pypi-server

for f in $(ls pypi-server-src);
do 
  cat pypi-server-src/$f | ./helmify pypi-server;
  mv pypi-server/templates/pyserver.yaml pypi-server/templates/$f;
  cat pypi-server/values.yaml >> pypi-server/values-all.yaml;
done
arttor commented 1 year ago

Hi @ComeBurguburu. Can you please elaborate on which part is missing in helmify for your use-case?

As i can see, the bash script handles manifests one-by-one which will not work, because:

This means that all app manifests should be passed to helmify at once. Currently, helmify supports only stdin as a source. You can use this script to pass all manifest from the given directory:

awk 'FNR==1 && NR!=1  {print "---"}{print}'  pypi-server-src/*.yaml | helmify pypi-server

The script reads all yamls from dir (script can be modified to read recursively and to use other file extensions), separates yaml objects with --- separator and pass everything to helmify at once.

The best option for overriding values.yaml is to use native helm features for overriding files (-f ) or concrete params (--set):

helm install -f myvalues.yaml  --set foo=bar
ComeBurguburu commented 1 year ago

Hi arttor, Thanks for this amazing tools

I find two issues:

arttor commented 1 year ago

got it. in this case, it makes sense to adjust the issue, to support input from the filesystem.

arttor commented 1 year ago

Hi @ComeBurguburu, the feature implemented in v0.4.0 release. Check it out!