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

Automatic updating of imported cluster configs #13

Closed
dbarentine opened this issue Jul 9, 2019 · 5 comments
Closed

Automatic updating of imported cluster configs #13

dbarentine opened this issue Jul 9, 2019 · 5 comments
Assignees
Labels

Comments

@dbarentine
Copy link

We have Kubernetes clusters that use OIDC for authentication. So, anytime it refreshes the token or reauthenticates I have to either manually update the config within kube-forwarder or delete and recreate.

An example of the part of our config that changes.
user: auth-provider: config: access-token: <access_token apiserver-id: <apiserver-id> client-id: <clientid> expires-in: "3599" expires-on: "1562692749" refresh-token: <refresh_token> tenant-id: <guid> name: azure

It would be nice if kube-forwarder did one of two things:

  • Detect the file change and automatically update the stored config.
  • Or, don't do a full import of the config. But instead, just create a pointer to the actual ~/.kube/config and fetch it on startup so it's always current.
@lnikell
Copy link
Member

lnikell commented Jul 16, 2019

Hi @dbarentine, we will read more about how OIDC works, so if I understand you correctly there is external sort of daemon that refreshes your token in kubeconfig periodically.

@lnikell lnikell added the idea label Jul 16, 2019
@dbarentine
Copy link
Author

@lnikell Yeah essentially. It's not so much a daemon but a webook token authentication that gets called when you try to make an authenticated call via kubectl.

This causes one of two things to happen:

  1. It forces an authentication (in our case using Microsoft's device login)
  2. It transparently refreshes the token using the refresh_token in the configuration.

Both result in an updated .kube/config file as the access-token value will be updated. Token expiration I think is 60 minutes so our .kube/config will be updated every 60 minutes if we are actively working with kubectl.

For more information, you can see the AAD Integration here: https://docs.microsoft.com/en-us/azure/aks/concepts-identity#azure-active-directory-integration

Or the Webhook Token Authentication here: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication

@lnikell
Copy link
Member

lnikell commented Jul 17, 2019

@dbarentine Thank you for clarification, we will try to come up with solution for that.

@proAlexandr
Copy link
Contributor

Hi, @dbarentine. We have released a new version. Now it's possible to set a path to a file instead of copying its content. I hope the feature will fix your issue. Please, feel free to try the update and share feedback with us. Thanks!

@proAlexandr proAlexandr self-assigned this Aug 2, 2019
@lnikell
Copy link
Member

lnikell commented Aug 2, 2019

Closing the issue, It should be resolved in the latest version as Alexandr mentioned.

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

3 participants