Introduce a k8s secret token persister, refacter filesytem token persister#125
Open
Introduce a k8s secret token persister, refacter filesytem token persister#125
Conversation
ce0445b to
4e87fca
Compare
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.
Description
For metal-stack components which are running in kubernetes we need to provide a mechanism to also run the periodic token refresher and store the newly fetched token in a given secret as the existing token was stored before.
This introduces kubernetes dependency to this repository, but consumers which only need to either implement the api contract or create a client or need the filesystem tokenpersister do not get the kubernetes dependency pulled in. This was ensured by putting the secret token persister in a dedicated package.
The secret token persister is actually based in client-go and the consumer must pass a
clientset kubernetes.Interface, so if the consumer is based on controller-runtime this must be taken care ofAlternative solution
It would also be possible to write a dedicated controller which will be deployed as a sidecar to every service running in kubernetes which talks to the metal-apiserver. This controller will get the same token as the real service and will run the secret rotation with the help of a tokenpersisterfunc and store the new token in the secret and will then trigger a restart of the real service.
Used AI-Tools ✨