API Server Authentication to AWS EKS (client.authentication.k8s.io/v1alpha1)

0

Error: Kubernetes cluster unreachable: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1\

EKS v1.23.10; kubectl 1.19.6; HELM 3.10.0; Maven 3.8.1; Jenkins 2.361; RHEL 8.6 While I try to connect to EKS from Jenkins server, the authentication error is displayed. What kind of authentication required and how to apply?

3 Respostas
0

Hello rkothama,

This issue occurs if you have updated your "kubeconfig" on your server using aws eks update-kubeconfig command using the older version of the AWS CLI.

Resolution: Please upgrade your AWS CLI on your Jenkins server to the latest version by following this doc and re-run the aws eks update-kubeconfig command to re-update your "kubeconfig" on your Jenkins server to fix this issue.

Please comment on this answer if you are still facing issues. Thank you!

profile pictureAWS
ENGENHEIRO DE SUPORTE
respondido há 2 anos
  • Well, on Jenkins Server, I did copy the kubeconfig contents from EKS server. I did not install aws cli. If it is required, I will install aws cli and check. I would appreciate you confirming for me.

  • Thanks for the reply!

    Yes, you can perform the steps that I mentioned earlier or you can also do the below steps (manual approach):

    Open the "~/.kube/config" file on your Jenkins server and check the "apiVersion" specified for your cluster. I believe it would be client.authentication.k8s.io/v1alpha1.

    Replace it with client.authentication.k8s.io/v1beta1 and your authentication should work.

    Thank you!

0

Hi Venkat, I tried to replace "v1alpha1" with "v1beta1" on Jenkins Server. However, it still says the following. Do I need to replace on EKS Cluster too? or install credential plugins. Does that sounds like required?

"Kubernetes cluster unreachable: Get "https://85D6BF0D2245D33BB97D2115ED77*****.gr7.us-west-2.eks.amazonaws.com/version": getting credentials: exec: executable aws-iam-authenticator not found". It looks like you are trying to use a client-go credential plugin that is not installed.

respondido há 2 anos
  • I think you could install the latest AWS CLI version and run the aws eks update-kubeconfig --name <cluster-name> command to fix this problem. The error you posted could be due to an outdated config file on your server. Running the update-kubeconfig command should fix this problem.

    Have you already tried doing that?

0

Venkat, thank you so much. I could deploy helm package onto AWS EKS Cluster from Jenkins on EC2 instance. Here is the output on EKS Cluster:

kubectl get pods

NAME READY STATUS RESTARTS AGE mysqldatabase-5dbf57c478-gs7rq 0/1 Pending 0 7m23s

respondido há 2 anos
  • That's great. Please accept my original answer as it might help others facing the same problem. Thank you!

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas