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

fix: use v1beta1 version in EKS user kubeconfig #3740

Merged

Conversation

dkoshkin
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:

client.authentication.k8s.io/v1alpha1 has been removed in Kubernetes v1.24 see aws/aws-cli#6920. EKS will soon support v1.24, to prepare for that we should use a version that will be supported. This also breaks anyone that uses kubectl >=1.24, so others may already be seeing this issue.

The oldest version that EKS supports is v1.20 https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html where v1beta1 was already available (and is still available even in 1.26)

# a newer kubectl version does not work
➜  kubectl version --client=true
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.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.0", GitCommit:"a866cbe2e5bbaa01cfd5e969aa3e033f3282a8a2", GitTreeState:"clean", BuildDate:"2022-08-23T17:36:43Z", GoVersion:"go1.19", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.7
➜  kubectl get node
error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"

# downloading kubectl v1.23.x or older will work with v1alpha1
➜ curl -LO "https://dl.k8s.io/release/v1.23.12/bin/darwin/amd64/kubectl"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   138  100   138    0     0   1792      0 --:--:-- --:--:-- --:--:--  1792
100 50.6M  100 50.6M    0     0  32.8M      0  0:00:01  0:00:01 --:--:-- 40.3M
➜ curl -LO "https://dl.k8s.io/release/v1.23.12/bin/darwin/amd64/kubectl"
➜ chmod +x kubectl
➜ ./kubectl get nodes
NAME                                         STATUS   ROLES    AGE   VERSION
ip-10-0-109-193.us-west-2.compute.internal   Ready    <none>   58m   v1.22.12-eks-ba74326
ip-10-0-127-152.us-west-2.compute.internal   Ready    <none>   58m   v1.22.12-eks-ba74326
ip-10-0-67-45.us-west-2.compute.internal     Ready    <none>   58m   v1.22.12-eks-ba74326
ip-10-0-73-222.us-west-2.compute.internal    Ready    <none>   58m   v1.22.12-eks-ba74326

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Sep 22, 2022
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 22, 2022
@sedefsavas
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 22, 2022
// Version v1 was released in Kubernetes v1.23.
// Version v1beta1 was selected as it has the widest range of support
// This should be changed to v1 once EKS no longer supports Kubernetes <v1.23
execConfig := &api.ExecConfig{APIVersion: "client.authentication.k8s.io/v1beta1"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah the last version was 1.19 with alpha, right? So this should be okay and not affect existing clusters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like 1.10 was the last version with no beta and only alpha https://github.com/kubernetes/kubernetes/tree/release-1.10/staging/src/k8s.io/client-go/pkg/apis/clientauthentication
I doubt anyone is still using that version, and definitely would not be able to install a new cluster with it.

@richardcase
Copy link
Member

I've been running into this a lot lately 🤣

@richardcase
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardcase

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 23, 2022
@k8s-ci-robot k8s-ci-robot merged commit 9e71830 into kubernetes-sigs:main Sep 23, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Sep 23, 2022
@dlipovetsky
Copy link
Contributor

/cherrypick release-1.5

I think this fix needs to be in the next 1.5 patch release.

@k8s-infra-cherrypick-robot

@dlipovetsky: new pull request created: #3763

In response to this:

/cherrypick release-1.5

I think this fix needs to be in the next 1.5 patch release.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dlipovetsky
Copy link
Contributor

/cherrypick release-1.6

@k8s-infra-cherrypick-robot

@dlipovetsky: new pull request created: #3781

In response to this:

/cherrypick release-1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants