Repository navigation
feat(chart): pass agent token hashes to the controller - #52
Merged
Merged
Conversation
The controller reads GRUS_AGENT_TOKENS to authenticate agent hosts, but the chart never set it. Add agents.tokens.existingSecret and key; when the Secret is named, the controller gets the variable from it. The Secret holds only SHA-256 hashes of the agent tokens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Hosts that run Grus instances outside the cluster authenticate to the controller with a token. The controller only accepts a token whose hash it knows, and it learns those hashes from an environment variable. The chart had no way to set that variable, so an operator who deployed the controller with the chart could not enable an agent host without patching the Deployment by hand.
Approach
The chart now takes an existing Secret, the same way it already takes the admin token. Operators create the Secret with the hashes, and the controller reads them at start. Nothing changes when the Secret is not named, so existing releases render exactly as before.
Testing
Rendered the chart with the default values, with the CI lint values and with the S3 template backend, before and after the change: the output is byte-identical. With the Secret named, the controller container receives the variable from that Secret.
helm lintpasses with the CI values and with the Secret named.