Skip to content

Parameter inheritence #302

@jaxxstorm

Description

@jaxxstorm

More of a feature request, maybe this is already possible but maybe not.

I use jk pretty heavily for regional deployments and the ability to set parameters for the regional deployments. As an example:

deployment/kube/jk/params
├── eu-central-1.yaml
├── us-east-1.yaml
└── us-west-2.yaml

Here you can see I've got parameter files for each region I deploy to.
Often, the configuration is the same for configurable values in lots of regions with a few slight differences. What I'd like to be able to do is have parameter inheritence through a directory tree, in a similar manner to hiera

How might this look in practice? Well, you'd have a directory structure like this:

deployment/kube/jk/params
├── defaults.yaml
├── regions
│   ├── eu-central-1.yaml
│   ├── us-east-1.yaml
│   └── us-west-2.yaml

Then, as an example, we'd have parameters in defaults.yaml like so:

s3_bucket: my_default_bucket

If the value existed lower down the hierarchy (for example, in regions/us-west-2.yaml it would be the preferred loaded parameter:

s3_bucket: my_uw2_bucket

If this value doesn't exist, it falls back to the default parameters in defaults.yaml.

I imagine this would be another params function, let's say:

const bucket = paramFromTree.String('bucket');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions