-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Kubernetes: does not reload projected service account token #4352
Comments
I created a PR to fix it #4487. Meanwhile you can mitigate it, using the Kube_Token_Command option, because this reloads the token every 600 seconds:
you may have to check the full path for cat, in the default docker image, its /usr/local/bin/cat |
This is only present in the |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
This issue was closed because it has been stalled for 5 days with no activity. |
* filter_kubernetes: add option kube_token_ttl The option sets the re-read frequency of the token for the defauld method and for option Kube_Token_Command. Default is 600 seconds. Signed-off-by: Michael Voelker <[email protected]> * filter_kubernetes: set kube_token_ttl default to 600s Signed-off-by: Michael Voelker <[email protected]> * filter_kubernetes: use FLB_CONFIG_MAP_TIME for kube_token_ttl config Signed-off-by: Michael Voelker <[email protected]>
* filter_kubernetes: add option kube_token_ttl The option sets the re-read frequency of the token for the defauld method and for option Kube_Token_Command. Default is 600 seconds. Signed-off-by: Michael Voelker <[email protected]> * filter_kubernetes: set kube_token_ttl default to 600s Signed-off-by: Michael Voelker <[email protected]> * filter_kubernetes: use FLB_CONFIG_MAP_TIME for kube_token_ttl config Signed-off-by: Michael Voelker <[email protected]> Signed-off-by: Manal Geries <[email protected]>
* filter_kubernetes: add option kube_token_ttl The option sets the re-read frequency of the token for the defauld method and for option Kube_Token_Command. Default is 600 seconds. Signed-off-by: Michael Voelker <[email protected]> * filter_kubernetes: set kube_token_ttl default to 600s Signed-off-by: Michael Voelker <[email protected]> * filter_kubernetes: use FLB_CONFIG_MAP_TIME for kube_token_ttl config Signed-off-by: Michael Voelker <[email protected]> Signed-off-by: a445943 <[email protected]>
Bug Report
Describe the bug
In EKS 1.21 projected service account tokens are enabled by default, so the token is renewed every hour and fluent-bit should reload it to use the latest token.
The feature is described here: https://github.com/kubernetes/enhancements/blob/master/keps/sig-auth/1205-bound-service-account-tokens/README.md
An example volume configuration:
To help with the migration, kube apiserver has some metrics to find related services which does not reload the token, described here:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-auth/1205-bound-service-account-tokens/README.md#serviceaccount-admission-controller-migration
In kube-apiserver-audit logs I see events like this, which shows that fluent-bit using an old token:
The relevant part is:
"authentication.k8s.io/stale-token": "subject: system:serviceaccount:monitoring:fluent-bit, seconds after warning threshold: 2766881"
.To Reproduce
Just use a kubernetes cluster with Bound Service Account Tokens feature enabled and wait for more than
expirationSeconds
time (1 hour by default) to see these events in kube apiserver audit logs.Expected behavior
Reload the service account token periodically, preferably less than the
expirationSeconds
set in projected volume.Your Environment
The text was updated successfully, but these errors were encountered: