Search code examples
amazon-web-serviceskubernetesamazon-eks

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

  • 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.