roboll / helmfile

Deploy Kubernetes Helm Charts
MIT License
4.05k stars 565 forks source link

v1: Alternative name for environment/state values? #1048

Open mumoshu opened 4 years ago

mumoshu commented 4 years ago

Background

We call Helmfile-specific template parameters as Environemnt Values or State Values today.

Those parameters can be loaded from helmfile.yaml or another yaml and yaml template files with the syntax:

values:
- foo: bar
- path/to/file.yaml

or

environments:
  prod:
    values:
    - foo: bar
    - path/to/file.yaml

Form the experience maintaining Helmfile for 1+ year, I'd say this name is so confusing and we'd need a better alternative.

Problems

The two biggest problems I see are:

What would be a name better than those two?

Ideas:

  1. Template Parameters
templateParameterss:
- foo: bar
- path/to/file.yaml

environments:
  prod:
    templateParameters:
    - ...
  1. Parameters
parameters:
- foo: bar
- path/to/file.yaml

environments:
  prod:
    parameters:
    - ...
  1. Template Variables
templateVariables:
- foo: bar
- path/to/file.yaml

environments:
  prod:
    templateVariables:
    - ...
  1. Variables
variables:
- foo: bar
- path/to/file.yaml

environments:
  prod:
    variables:
    - ...
  1. State Parameters
stateParameters:
- foo: bar
- path/to/file.yaml

environments:
  prod:
    stateParameters:
    - ...

Comments

Generally speaking, something named after parameters seems more appropriate than variables as it isn't modifiable. Anything called a variable looks modifiable to me.

If you're familiar with Terraform, variables might better fit your mind model though

Alternatives

Just use another config languange and its runtime that has built-in support for importing another files?

Examples:

You prefer HCL(2)?

To be clear, hcl2 alone won't be alternative to the aboves as it doesn't have builtin-functions and/or "import" feature as far as I know.

However it would be possible to make sprig and other helmfile template functions available to hc2 context so that it can be comparable to CUE, Jsonnet, jkcfg as a whole.

osterman commented 4 years ago

I like this suggestion. I think it will make it easier to document what is happening.

I also like the parameters suggestion.

peterloron commented 4 years ago

I think any of the suggested alternatives is more clear than the current implementation. I like "parameters". The key, really, will be clear documentation on how and why they are used.

sebnyberg commented 4 years ago

This is a great suggestion. Re-using the term "values", which is already part of the Helm lingo was the biggest pain point for me when learning how to use Helmfile a few months back. It is also the main point of confusion for my colleagues.