Skip to content

Feature: Use tpl to template config from values. #232

@cognifloyd

Description

@cognifloyd

I do not use any of the external charts as that infrastructure is handled separately in our environments.
I also use helm-secrets to load secrets from our hashi vault.

For many of the values, grabbing the secret is very straightforward: password: !vault secretv2/path/to/secret/password.
But, for st2.config and for st2chatops.env, only parts of them need to be pulled from the vault (eg a redis password, rabbitmq credentials, or a slack token).

I would rather not store entire config files in vault. But, if we template these values with tpl () ., then I can easily reference my own values with something like this:

cognifloyd:
  rabbitmq:
    username: !vault secretv2/path/to/rmq/username
    password: !vault secretv2/path/to/rmq/password
  chatops:
    slack_token: !vault secretv2/path/to/slack/token
st2:
  config: |
    ...
    [messaging]
    url = amqp://{{ .Values.cognifloyd.rabbitmq.username }}:{{ .Values.cognifloyd.rabbitmq.password }}@my-rmq-host.example.com:5672/
    ...
st2chatops:
  env:
    ...
    HUBOT_SLACK_TOKEN: "{{ .Values.cognifloyd.chatops.slack_token }}"
    ...

I have a branch prepared to add this feature: https://github.com/cognifloyd/stackstorm-ha/tree/tpl-config
I will submit a PR later.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions