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

[Bug] Incompatible with latest kubectl release #5689

Closed
stmcginnis opened this issue Sep 9, 2022 · 6 comments
Closed

[Bug] Incompatible with latest kubectl release #5689

stmcginnis opened this issue Sep 9, 2022 · 6 comments
Labels
kind/help Request for help stale

Comments

@stmcginnis
Copy link

What were you trying to accomplish?

Attempting to create a new EKS cluster.

What happened?

Creating a new EKS cluster on a new system, I had installed kubectl using the instructions on the Linux install page:

curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"

This installs the latest stable release of kubectl, which appears to be version v1.25.0 at this point.

I then attempt to create the new cluster. All goes well until the end where an error is emitted due to unexpected output from kubectl version:

$ eksctl create cluster --region us-east-2 --name test
2022-09-09 17:01:01 [ℹ]  eksctl version 0.107.0
2022-09-09 17:01:01 [ℹ]  using region us-east-2
2022-09-09 17:01:01 [ℹ]  setting availability zones to [us-east-2b us-east-2c us-east-2a]
...
2022-09-09 17:18:07 [✖]  unable to use kubectl with the EKS cluster (check 'kubectl version'): WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Unable to connect to the server: 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"

2022-09-09 17:18:07 [ℹ]  cluster should be functional despite missing (or misconfigured) client binaries
2022-09-09 17:18:07 [✔]  EKS cluster "test" in "us-east-2" region is ready

It looks like this is due to kubectl deprecating/changing the output format for kubectl version --short:

$ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.0
Kustomize Version: v4.5.7

Versus the "old" output from the v1.22.0 release:

kubectl version --short
Client Version: v1.22.0

How to reproduce it?

Appears to be reproducible with any cluster creation attempt having at least kubectl v1.25.0 or later installed.

Versions

$ eksctl info
eksctl version: 0.107.0
kubectl version: v1.25.0
OS: linux
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2022

Hello stmcginnis 👋 Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-3 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

@TiberiuGC TiberiuGC added kind/help Request for help and removed kind/bug labels Sep 21, 2022
@TiberiuGC
Copy link
Contributor

Hello - I've tried creating a cluster with kubectl version 1.25.0 and it worked just fine for me.

The error you're seeing above doesn't have to do with the format of kubectl version --short. Printing this output is just a default thing we're doing in case we're getting an error when "asking" kubectl for its version. See the error here and the suggestion we're printing here.

The actual issue you're facing seems to be displayed on the line below:
Unable to connect to the server: 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"

Checking my kubeconfig I notice that I'm using a different client authentication version:
apiVersion: client.authentication.k8s.io/v1beta1

Could you please try

  • upgrading to latest aws cli
  • run eksctl utils write-kubeconfig --cluster=<name>
  • check in your ~/.kube/config file that apiVersion has been updated to client.authentication.k8s.io/v1beta1

Afterwards kubectl commands should work on your cluster. 🤞

@jglick
Copy link

jglick commented Oct 11, 2022

Duplicate of #5257?

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Nov 11, 2022
@stmcginnis
Copy link
Author

Sorry, somehow missed previous comments.

@TiberiuGC
Copy link
Contributor

@stmcginnis no worries, thanks for closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/help Request for help stale
Projects
None yet
Development

No branches or pull requests

3 participants