'AWS EKS - Get available Kubernetes versions
I am looking for a programmatic way to get available Kubernetes versions in AWS EKS. Something similar to the following Azure CLI command:
az aks get-versions --location eastus --output table
Solution 1:[1]
As mentioned earlier, there is no API that explicitly returns the list of available Kubernetes versions available in AWS EKS. However, there is a somewhat hacky way to get this by describing all add-on versions available and getting the K8s versions they are compatible with.
I guess it would be a fair assumption that all available K8s versions in EKS would be compatible with some add-on or the other. In which case, the below CLI command will return the list of available Kubernetes versions present in EKS which can be used.
aws eks describe-addon-versions | jq -r ".addons[] | .addonVersions[] | .compatibilities[] | .clusterVersion" | sort | uniq
The command gets all Add-ons for EKS and each Add-ones compatible version and then uses jq utility to get the unique Kubernetes versions.
Solution 2:[2]
Is this what you are looking for?
aws eks describe-cluster --name CLUSTER_NAME --region eu-west-2 --query 'cluster.version'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kumar harshit |
| Solution 2 | QGA |
