Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template st2client conf #262

Merged
merged 6 commits into from
Nov 10, 2021
Merged

Conversation

cognifloyd
Copy link
Member

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.

@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Nov 1, 2021
@cognifloyd cognifloyd added enhancement New feature or request Helm RFR labels Nov 1, 2021
@cognifloyd cognifloyd requested a review from arm4b November 1, 2021 15:56
@cognifloyd
Copy link
Member Author

@armab RFR

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice feature now that would work for everyone!
Thanks a lot for finding the way here 👍

Left one minor comment to address, otherwise looks great.

@@ -623,6 +623,14 @@ st2sensorcontainer:
# The st2client deployment/pod simplifies ad-hoc administration.
# st2client is a special purpose actionrunner pod, but you can customize it separately
st2client:
# st2client config (~/.st2/config) template.
# You can access env variables here because this is used in a bash heredoc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
Let's just include a link to https://docs.stackstorm.com/reference/cli.html#configuration-file in comments for both Helm value definitions.

That'll help users find the use cases and configuration examples easily.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@arm4b arm4b merged commit b0c73e7 into StackStorm:master Nov 10, 2021
@cognifloyd cognifloyd deleted the template-st2client-conf branch November 11, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Helm RFR size/M PR that changes 30-99 lines. Good size to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Allow hook/jobs to use an st2 api_key instead of user/pass
2 participants