aws / aws/aws-cli

Add `--api-version` flag to `aws eks get-token` to support newer versions

Open
#6,916 9 comments 33 reactions 0 assignees View on GitHub
customization eks-kubeconfig feature-request p2
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the feature

I'd like to be able to request a specific `client.authentication.k8s.io` API version to be returned when calling `aws eks get-token` via a `--api-version` flag.

For example `aws eks get-token --cluster-name my-cluster --api-version v1beta1`.

We would need the same flag for the `aws eks update-kubeconfig` command too.

### Use Case

When using `aws eks get-token` as a client-go credential plugin the API version being used needs to be specified in the calling code. This means changing the default in the command will break all usages until both the binary and calling code have been updated. By adding the `--api-version` flag the calling code will always be valid as long as the specified API version is supported by the cluster.

### Proposed Solution

Add a `--api-version` flag to the `aws eks get-token`. Either only support API versions which are available in all EKS versions or error if the API version isn't available on the cluster.

### Other Information

With the release of [Kubernetes v1.24.0](https://kubernetes.io/blog/2022/05/03/kubernetes-1-24-release-announcement/) `client.authentication.k8s.io/v1alpha1` has been [removed](https://github.com/kubernetes/kubernetes/pull/108616).

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CLI version used

n/a

### Environment details (OS name and version, etc.)

All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.