Skip to content

Introduce a k8s secret token persister, refacter filesytem token persister#125

Open
majst01 wants to merge 1 commit intomainfrom
kubernetes-secret-token-persister
Open

Introduce a k8s secret token persister, refacter filesytem token persister#125
majst01 wants to merge 1 commit intomainfrom
kubernetes-secret-token-persister

Conversation

@majst01
Copy link
Copy Markdown
Contributor

@majst01 majst01 commented Apr 28, 2026

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 of

Alternative 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 ✨

  • Qwen3.6 on our DGX Spark used for generation

@majst01 majst01 force-pushed the kubernetes-secret-token-persister branch from ce0445b to 4e87fca Compare April 29, 2026 10:58
@majst01 majst01 self-assigned this Apr 29, 2026
@majst01 majst01 marked this pull request as ready for review April 29, 2026 12:27
@majst01 majst01 requested a review from a team as a code owner April 29, 2026 12:27
@majst01 majst01 requested a review from simcod April 29, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant