Open dherbrich opened 3 years ago
@dherbrich Thanks for opening this issue. What I am seeing here is two requests:
A way to start by defining values in YAML as opposed to a data values file, which is maybe the preferred user experience of a lot of folks. I think it's really interesting and think it would be worthwhile to discuss this idea further.
A validation approach for requiring data values. We do support workarounds for this now, such as assertions. Example of its use shown here. But we do realize the UX is not the best for this right now, which is why we are developing ideas around ytt
schemas to potentially address issues such as this. This is admittedly still undergoing refinement, but we are hoping it will be the long term solution for this.
This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.
Generating data values files is a great idea. This would be a nice feature to add to our schema proposal. We could generate a data values file from a schema.
We will update the schema proposal to include this feature. You can find the proposal here.
Adding a command for validation is also an interesting idea. I opened a separate issue to track it. #278
Describe the problem/challenge you have I was parameterizing a k8s yaml file and added a bunch of data values into it, e.g.:
The needed _values-skeleton.yml looks like this:
Currently this needs to be done by hand/manually. This is especially challenging if you need to merge multiple yaml snippets to compose an application/deployment unit and want to create a data values file for it. It would also be nice to validate/annotate unused data values in a value file when applied to a set of input files.
Describe the solution you'd like Given the first snippet of a prepared yaml file/template, I would like to have a functionality that I can invoke via cli to generate the output as described in the second snippet above:
ytt values generate -f application.yml -o values.yml
For validation and checking for unused values I would propose something like this:Anything else you would like to add: [Additional information that will assist in solving the issue.]