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

BoundServiceAccountTokenVolume refresh token with EKS 1.21 #3757

Closed
amalendur opened this issue May 25, 2022 · 7 comments
Closed

BoundServiceAccountTokenVolume refresh token with EKS 1.21 #3757

amalendur opened this issue May 25, 2022 · 7 comments

Comments

@amalendur
Copy link

Describe the bug

Hi,

Kubernetes version 1.21 graduated BoundServiceAccountTokenVolume feature [1] to beta and enabled it by default. This feature improves security of service account tokens by requiring a one hour expiry time, over the previous default of no expiration. This means that applications that do not refetch service account tokens periodically will receive an HTTP 401 unauthorized error response on requests to Kubernetes API server with expired tokens.

In our kubernetes audit logs we see that fluentd still using stale tokens

annotations.authentication.k8s.io/stale-token | subject: system:serviceaccount:logging:fluentd-forwarder, seconds after warning threshold: 53577
-- | --

What I understand, that should be fixed by upgrading kubernetes client SDK to latest release as following

* Go v0.15.7 and later
* Python v12.0.0 and later
* Java v9.0.0 and later
* Javascript v0.10.3 and later
* Ruby master branch
* Haskell v0.3.0.0

What did you expect to happen?

Fluentd to support BoundServiceAccountTokenVolume refresh token after upgrading to k8s 1.21

To Reproduce

install fluentd in kubernetes/eks cluster with version >= 1.21 and check the kubernetes audit logs for stale-token

Expected behavior

should have fixed the stale-token issue.

Your Environment

- Fluentd version: v0.3.7 (image : 1.14.6-debian-10-r49)
- Kubermetes/EKS :  v1.21

Your Configuration

Using image: 1.14.6-debian-10-r49

Your Error Log

annotations.authentication.k8s.io/stale-token | subject: system:serviceaccount:logging:fluentd-forwarder, seconds after warning threshold: 53577

Additional context

No response

@DevAndrewGeorge
Copy link

+1 to this.

@lcohen-11
Copy link

Hi,
I face the same issue.

@Mrunali0721
Copy link

Hello, Facing the same issue.

@pnuccioiqvia
Copy link

Hello,
We are also this issue, we need a fix ASAP.
thank you

@ashie
Copy link
Member

ashie commented Jun 6, 2022

To Reproduce

install fluentd in kubernetes/eks cluster with version >= 1.21 and check the kubernetes audit logs

Please describe the detail of the steps to reproduce what you did.

Fluentd core itself doesn't aware k8s. k8s integration of Fluentd is completely done by third-party plugins, and they aren't controlled by our organization. So probably you need to forward your report to somewhere (fluent-plugin-kubernetes_metadata_filter?).

Your Environment

- Fluentd version: v0.3.7 (image : 1.14.6-debian-10-r49)
- Kubermetes/EKS :  v1.21

We don't aware such version of Fluend or Docker container.
Probably you use a docker container which is maintained by other organization (here?).

@ashie
Copy link
Member

ashie commented Jun 7, 2022

We'll continue this issue at fluent/fluentd-kubernetes-daemonset#1361

@ashie ashie closed this as completed Jun 7, 2022
@ashie
Copy link
Member

ashie commented Jun 29, 2022

This issue has been addressed by fluent-plugin-kubernetes_metadata_filter: fabric8io/fluent-plugin-kubernetes_metadata_filter#337
Please use fluent-plugin-kubernetes_metadata_filter v2.11.1 or later.

monotek added a commit to monotek/fluentd-elasticsearch that referenced this issue Jul 5, 2022
* Update fluent-plugin-kubernetes_metadata_filter to 2.11.1

To be compatible with BoundServiceAccountTokenVolume feature introduced in kubernetes 1.21.

More details:
* fluent/fluentd#3757
* https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume
* https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#kubernetes-1.21

* Update other gems

* Update Gemfile

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants