I want to upgrade Amazon Elastic Kubernetes Service (Amazon EKS) add-ons.
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
Check the add-on versions that you can use
To identify the versions of the add-ons that you can use for your Amazon EKS cluster version, run the following describe-addon-versions AWS CLI command:
aws eks describe-addon-versions --kubernetes-version=cluster-version --addon-name=addon-name --query='addons[].addonVersions[].addonVersion'
Note: Replace cluster-version with the Kubernetes version of your Amazon EKS cluster. Also, replace addon-name with the name of the add-on, such as vpc-cni or coredns.
Upgrade the add-ons
If your add-ons have custom configurations or resources that differ from the default settings, then you might encounter conflicts when you upgrade. To resolve these issues, use the AWS CLI and the --resolve-conflicts option to upgrade your add-ons. It's a best practice to test the upgrade process in a non-production environment before you apply it to your production cluster. For more information, see How do I prevent configuration conflicts when I create or update my Amazon EKS managed add-ons?
To upgrade the add-ons, use eksctl, the Amazon EKS console, or the AWS CLI.
Verify the upgrade
Use the kubectl command to check the status of the add-on deployments and make sure that the pods are running the new version. For daemonset add-ons, such as vpc-cni and kube-proxy, check whether the number of replicas is equal to the number of nodes. The vpc-cni and kube-proxy add-ons don't run on AWS Fargate or Windows nodes.
For example, run the following command to check the current version of the CoreDNS deployment:
kubectl describe deployment coredns -n kube-system | grep Image | cut -d ":" -f 3
Or, complete the following steps to check the add-on details in the Amazon EKS console:
- Open the Amazon EKS console.
- In the navigation pane, choose Clusters.
- Choose your cluster.
- Choose the Add-ons tab.
- To view the new version, check the value in the Add-on version column.
To check the logs of the add-on pods for errors or issues that occurred during the upgrade process, run the following command:
kubectl logs -n kube-system -l k8s-app=kube-dns
Run additional tests
To determine whether your add-on requires additional tests after an upgrade, check the documentation for add-ons for best practices. It's also a best practice to test add-ons that manage core services such as networking or DNS resolution. If you added custom configurations to your add-on, then make sure that your settings still operate as expected after the upgrade.
To test the Amazon Virtual Private Cloud (Amazon VPC) Container Network Interface (CNI) add-on, create a new pod to validate IP address assignment. For the CoreDNS add-on, use the exec command to get into the pod, and then use tools such as nslookup to validate DNS resolution.
Related information
Update the CoreDNS Amazon EKS self-managed add-on
Update the Amazon VPC CNI (Amazon EKS add-on)
Manage CoreDNS for DNS in Amazon EKS clusters