template st2client conf by cognifloyd · Pull Request #262 · StackStorm/stackstorm-k8s

This moves the /root/.st2/config template (a bash heredoc) to values so that it can be adjusted based on install requirements. This also makes secrets in envFromSecrets available to the generate-st2client-config initContainers so that they can be used within the bash heredoc template. The template value is also passed through tpl to support helm templating for any non-secret config such as injecting the timezone.

Relevant st2 docs on the st2client config file: https://docs.stackstorm.com/reference/cli.html#configuration-file

Closes #233
Closes #256
Closes #261

Note: This PR is an alternate implementation of #256 and #261 based on @armab's feedback in #261.
I want to provide the ST2_API_KEY via envFromSecrets, but the /root/.st2/client config with a username takes precedence over the ST2_API_KEY env var. Templating the file allows me to either inject the api_key in the config file, or remove the credentials so that the ST2_API_KEY var is used.