containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[EKS] : Apiserver Auditing failed of request: encoding failed: authentication Error

Open oguzhanaygn opened this issue 6 years ago • 14 comments

Hi,

I created a AWS EKS 1.18 Cluster and enabled all the control plane logs. When I checked the api server logs on CloudWatch,

"Auditing failed of request: encoding failed: authentication.TokenRequest is not suitable for converting to "v1" in scheme "k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go" logs are coming. But I didn't do any fundamental change on cluster. Can it be a bug?

Thank you.

oguzhanaygn avatar Nov 30 '20 09:11 oguzhanaygn

I have the same error.

W1207 14:04:54.006923       1 request.go:157] Auditing failed of  request: encoding failed: authentication.TokenRequest is not suitable for converting to "v1" in scheme "k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30"
I1207 16:01:20.225279       1 log.go:172] http: TLS handshake error from xxx.xxx.xxx.xxx:53052: tls: client offered only unsupported versions: [302 301 300]

framled avatar Dec 07 '20 20:12 framled

ref kubernetes/kubernetes#98612

njuptlzf avatar May 17 '21 03:05 njuptlzf

👍🏻 same thing. I don't think this is expected.

EKS running Kubernetes 1.21 and AMI 1.21.5-20211117.

nodesocket avatar Dec 07 '21 00:12 nodesocket

Same error. Has been in effect for about a week according to my user reports. Kubernetes v1.19, eks.6.

xlvdk avatar Dec 08 '21 10:12 xlvdk

I'm seeing this error as well on EKS K8s 1.21 and AMI 1.21.5-20220112.

I have another eks cluster running on K8s 1.21 and AMI 1.21.5-20211206 that works fine

S4NT14G0 avatar Jan 18 '22 21:01 S4NT14G0

Same thing

niemyjski avatar Jan 20 '22 21:01 niemyjski

I'm seeing this error as well on EKS K8s 1.21 and AMI 1.21.5-20220112.

I have another eks cluster running on K8s 1.21 and AMI 1.21.5-20211206 that works fine

So, then this is regression? The AMI 20220112 is having this issue but the older AMI version 20211206 is fine?

nodesocket avatar Jan 20 '22 21:01 nodesocket

@nodesocket correct. To reproduce create a new eks cluster and install ingress-nginx, cert-manager, or external-dns and all three of the pods will fail to start on the newer ami due to them being unable to access the k8s api server token. The old ami they all work fine though I have seen an skbn cron job fail on the older ami with the same error, but I will probably use a workaround i found to get that working. When I get back to my computer at work I will post some more information to be more thorough. I'm currently going to spin up a new cluster on 1.20 or 1.19 and install my services on there as a workaround.

S4NT14G0 avatar Jan 22 '22 00:01 S4NT14G0

Same thing observed on 1.21 with ami 1.21.5-20220112 after enable all types of control plane logging

W0126 09:13:13.702684 11 request.go:161] Auditing failed of request: encoding failed: authentication.TokenRequest is not suitable for converting to "v1" in scheme "k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30"

W0126 09:20:39.436336 11 watcher.go:220] watch chan error: etcdserver: mvcc: required revision has been compacted

deepshock-211120 avatar Jan 26 '22 09:01 deepshock-211120

@nodesocket I take my earlier comment back. After logging in and checking on my 1.21 server using the old AMI 1.21.5-20211206 the problem has began to occur. All of my system services like ingress-nginx, cert-manager, prometheus, & external-dns are now failing (I made no changes since my comment 5 days ago). They are all complaining about not having permission to get K8s API server token. It seems like this is a bug affecting 1.21 and not specific AMIs. For everyone else experiencing this issue I'm going to be bringing up new clusters on 1.20 and will report back if it works. This could be a suitable work around until eks fixes the issues with 1.21

S4NT14G0 avatar Jan 26 '22 16:01 S4NT14G0

We need this change merged into EKS to stop these log messages. This is included with the upcoming EKS v1.22 release. For now, you can safely ignore the messages.

mikestef9 avatar Jan 26 '22 18:01 mikestef9

@mikestef9 Is this message not an indication of a larger problem? I'm not sure if others are experiencing the same issue in eks, but it seems like the latest update 1.21 is causing issues with the API token being injected into pods as they start up. Below I attached some logs from a cert-manager pod. Ever since upgrading to 1.21 I've been having failures across many services with the same error. I read the k8s release notes and guides to upgrading from 1.19 -> 1.20 -> 1.21 and there doesn't seem to be any indication of changes to the mechanism to allow pods to access token to communicate w/ the K8s api. The only indicator I have found in my clusters is the error message @framled posted above.

image

S4NT14G0 avatar Jan 26 '22 19:01 S4NT14G0

Issue still persist on eks

dokuboyejo avatar Feb 15 '22 20:02 dokuboyejo

looks like eks 1.22 is now available - https://aws.amazon.com/blogs/containers/amazon-eks-now-supports-kubernetes-1-22/

chancepants avatar Apr 05 '22 16:04 chancepants