EKS doesnt start getting Kubernetes version on EKS cluster: error running `kubectl version`: exit status 1 (check 'kubectl version')

0

hello. Im trying to start EKS cluster by next steps: 1 - install AWS cli 2 - install EKScli by that instruction - https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/setting-up-eksctl.html 3 - install kubectl by that instruction - https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html 4 - eksctl create cluster --name=cluster07 --version=1.29 --region=eu-central-1 --nodegroup-name=linux-nodes01 --node-type=t3.micro --nodes=2 during creating i have an error: [✖] getting Kubernetes version on EKS cluster: error running kubectl version: exit status 1 (check 'kubectl version')

after that i did: root@ubuntu01:/home/user1# kubectl version --client Client Version: v1.29.3 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 root@ubuntu01:/home/user1# chmod +x ./kubectl root@ubuntu01:/home/user1# mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH root@ubuntu01:/home/user1# kubectl version --client Client Version: v1.29.3 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 root@ubuntu01:/home/user1# aws eks update-kubeconfig --region eu-central-1 --name cluster07 Added new context arn:aws:eks:eu-central-1:562464429819:cluster/cluster07 to /root/.kube/config root@ubuntu01:/home/user1# kubectl get nodes error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1" root@ubuntu01:/home/user1# kubectl get nodes -o wide error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

also i changed v1alpha1 to v1beta1 - still same problem

tried different OS - same

plz help me to start EKS

demandé il y a 8 mois1,8 k vues
4 réponses
0

Let's tackle your issue step by step to find a solution:

  • Check that your kubectl client version is compatible with the EKS cluster's Kubernetes version. AWS EKS typically supports kubectl versions that are +/- 1 minor version from the cluster's version.
  • Update AWS CLI using pip install awscli --upgrade --user.
  • Update eksctl by following instructions on its AWS documentation.
  • The error about invalid apiVersion "client.authentication.k8s.io/v1alpha1" suggests an issue with the authentication API version. Since manually changing to v1beta1 didn't help, ensure any plugins or the AWS CLI/SDK managing kubeconfig are up to date.
  • Regenerate your kubeconfig file with aws eks update-kubeconfig --region eu-central-1 --name cluster07.
  • Verify any external plugins, like AWS IAM authenticator, are updated. Check for kubectl plugins that might affect authentication.
  • Debug authentication issues with kubectl get nodes --v=9 for detailed error messages.
profile picture
EXPERT
répondu il y a 8 mois
profile picture
EXPERT
vérifié il y a 8 mois
  • 1 - kubectl version --client Client Version: v1.29.3 2 - aws-cli/1.22.34 Python/3.10.4 Linux/5.15.0-50-generic botocore/1.23.34 3- eksctl version 0.175.0 4 - done before 5 - aws-cli/1.22.34 Python/3.10.4 Linux/5.15.0-50-generic botocore/1.23.34 6 - done before 7 - no any plugins 8 kubectl get nodes --v=9 I0326 21:37:33.723394 18440 loader.go:395] Config loaded from file: /root/.kube/config I0326 21:37:33.724601 18440 round_trippers.go:466] curl -v -XGET -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.29.3 (linux/amd64) kubernetes/6813625" 'https://BA23B0A2CEE451D920C4119B0077F99B.gr7.eu-central-1.eks.amazonaws.com/api?timeout=32s' I0326 21:37:34.229504 18440 round_trippers.go:553] GET https://BA23B0A2CEE451D920C4119B0077F99B.gr7.eu-central-1.eks.amazonaws.com/api?timeout=32s in 504 milliseconds I0326 21:37:34.229579 18440 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 0 ms TLSHandshake 0 ms Duration 504 ms I0326 21:37:34.229708 18440 round_trippers.go:577] Response Headers: E0326 21:37:34.230222 18440 memcache.go:265] couldn't get current server API group list: Get "https://BA23B0A2CEE451D920C4119B0077F99B.gr7.eu-central-1.eks.amazonaws.com/api?timeout=32s": getting credentials: decoding stdout: no kind "ExecCredential" is registered for version "client.authentication.k8s.io/v1alpha1" in scheme "pkg/client/auth/exec/exec.go:62" I0326 21:37:34.230510 18440 cache

  • 1 more thing - here is conf file server: https://BA23B0A2CEE451D920C4119B0077F99B.gr7.eu-central-1.eks.amazonaws.com name: cluster07.eu-central-1.eksctl.io contexts:

    • context: cluster: arn:aws:eks:eu-central-1:562464429819:cluster/cluster07 user: arn:aws:eks:eu-central-1:562464429819:cluster/cluster07 name: arn:aws:eks:eu-central-1:562464429819:cluster/cluster07
    • context: cluster: cluster07.eu-central-1.eksctl.io user: tf@cluster07.eu-central-1.eksctl.io name: tf@cluster07.eu-central-1.eksctl.io current-context: arn:aws:eks:eu-central-1:562464429819:cluster/cluster07 kind: Config preferences: {} users:
    • name: arn:aws:eks:eu-central-1:562464429819:cluster/cluster07 user: exec: apiVersion: client.authentication.k8s.io/v1beta1 args: - --region - eu-central-1 - eks - get-token - --cluster-name - cluster07 command: aws
    • name: tf@cluster07.eu-central-1.eksctl.io user: exec: apiVersion: client.authentication.k8s.io/v1beta1 args: - eks - get-token - --output - json - --cluster-name - cluster07 - --region - eu-central-1 command: aws env: - name: AWS_STS_REGIONAL_ENDPOINTS value: regional provideClusterInfo: false

    but i still have message about 1alpha1 in logs, may be i have to change it somewhere?

  • As a troubleshooting step, consider removing the existing kubeconfig for your cluster and regenerate it using the aws eks update-kubeconfig command. Sometimes, starting fresh can resolve unexpected issues.

0

As a troubleshooting step, consider removing the existing kubeconfig for your cluster and regenerate it using the aws eks update-kubeconfig command. Sometimes, starting fresh can resolve unexpected issues.

  • done it before, didn't help
répondu il y a 8 mois
0

try it 6 times - doesnt work...

répondu il y a 7 mois
0

Hello Edwards the issue seems to be because of awscli version.

As I can see you are still using awscli v1, Please migrate to awscli v2 following the documentation https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-instructions.html and then run update kubeconfig command again aws eks update-kubeconfig --region eu-central-1 --name cluster07.

The above shall resolve the issue.

AWS
INGÉNIEUR EN ASSISTANCE TECHNIQUE
répondu il y a 7 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions