Cray-HPE / loftsman

Define, organize, and ship your Kubernetes workloads with Helm charts easily
MIT License
9 stars 5 forks source link

Is there a way to see the final "values" for a helm chart after loftsman applies the manifest? #7

Open nerscchris opened 3 years ago

nerscchris commented 3 years ago

Hi there,

I'm starting to write a loftsman (version 1.0.3) manifest to bring in the Percona XtraDB DB helm chart and was thinking it would be really useful if there was a way for loftsman to display to me the result of overlaying the values from its manifest.json on top of the embedded values contained in the helm chart.

For instance I want to ensure that the volumes created for the database server are 200GB and not 8GiB. :-)

I see there's a loftsman manifest validate already, but that just seems to validate a manifest against its schema (if I'm interpreting it right). Am I missing something or is this a feature request?

All the best! Chris

rockholla commented 3 years ago

This is a really good idea.

It was never built into loftsman initially, but the idea of being able to render all k8s related resources has been one that's been done with other tools used alongside loftsman, and proved useful. loftsman manifest render for doing that whole k8s resource rendering and loftsman manifest render --values=all, loftsman manifest render --values=my-chart,another-chart, that sort of interface, for just output limited to resulting values to be applied I think is a great idea. I will mark this as a proposed feature considering. Let me know if you have other suggestions or input here Chris. Thanks for this!

rockholla commented 3 years ago

I just realized, too, that you mentioned "after loftsman applies the manifest." I think you were probably after something else equally as important: something like historically tracking the final values actually used when a manifest is applied.

We have a historical record of the manifest applied tracked currently, which includes the override values, and you can reference the chart version values, but yeah, the ability to not just see override values applied, rather what the resulting values are merged together seems like it could be useful.

In the meantime, you can take the values field content in the manifest record, put it in a file like values.yaml, make sure you have the packaged chart version referenced in the manifest, and run a command like helm template -f values.yaml [packaged-chart]-[version].tgz. Hope this helps!

nerscchris commented 3 years ago

Hey Patrick,

My pleasure! I'd forgotten about the helm template model to render it out and I agree that loftsman render is more obvious than helm template's naming. I do like that idea of being able to tease out the overridden values used for a previous deployment too, that could be really useful.

Thanks for that tip too, I'll give that a go - and it seems I can easily pull those values out of the loftsman manifest to that end with yq read manifest.yaml spec.charts.[0].values which is neat, and it works nicely like this:

helm template -f <(yq read manifest.yaml spec.charts.[0].values) ./pxc-db/

So that definitely confirms that some of what I'm setting is working, and points me to another question I need to solve! 😄

Very much appreciated! Chris