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

Refresh service account tokens regularly #17

Open
mnkg561 opened this issue Mar 25, 2020 · 0 comments
Open

Refresh service account tokens regularly #17

mnkg561 opened this issue Mar 25, 2020 · 0 comments
Labels

Comments

@mnkg561
Copy link
Contributor

mnkg561 commented Mar 25, 2020

Is this a BUG REPORT or FEATURE REQUEST?:
FEATURE REQUEST

What happened:
Since we are using k8s native way to connect to the target clusters which is nothing but using bearer token of a service token, may be its a good idea to keep refreshing those credentials. we can add the token to a service token using https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#to-create-additional-api-tokens.

We can have 2 tokens at any time and every time before controller validates the connectivity, it can pick the latest token to do the validation and can delete if the old token "lastUsedTimeStamp" is more than 30 mins. as soon as it deletes the oldest token it should create new token.
What you expected to happen:
For every reconciliation at cluster-controller,

  1. Get the best(recently created) token out of available tokens.
  2. Validate the oldest token and delete it if lastusedTimeStamp is more than 30 mins
  3. Delete the token only if connectivity is successful with other token
  4. Create new token if there is only one token in the list.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • manager version
  • Kubernetes version :
$ kubectl version -o yaml

Other debugging information (if applicable):

- controller logs:

$ kubectl logs

@mnkg561 mnkg561 added enhancement New feature or request cluster controller labels Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant