Sub topic 9
Managing Cluster Add-ons
This chapter assumes you have created a cluster with eksctl, understand the Amazon VPC CNI, and can use kubectl and the AWS CLI. It covers what EKS add-ons are, how to manage them, and the errors you will most often hit.
What an add-on is
An EKS add-on is operational software that EKS installs and maintains for you, such as the VPC CNI, CoreDNS, kube-proxy, the EBS CSI driver, and the EKS Pod Identity Agent. Every cluster needs some of these to work at all. Others, like the EBS CSI driver, you add when a feature requires them.
Managing them as add-ons gives you three things:
- AWS publishes a list of versions that are compatible with each Kubernetes version.
- You install, update, and remove them through the EKS API, so you can script and audit the changes.
- You can attach an IAM role to the add-on, so it gets AWS permissions without extra manual setup.
How an add-on moves through its lifecycle
Finding and installing an add-on
First list the versions that match your cluster's Kubernetes version. Then create the add-on.
aws eks describe-addon-versions \
--addon-name aws-ebs-csi-driver \
--kubernetes-version 1.31 \
--query 'addons[].addonVersions[].addonVersion'
aws eks create-addon \
--cluster-name demo \
--addon-name aws-ebs-csi-driver \
--service-account-role-arn arn:aws:iam::111122223333:role/ebs-csi-roleCheck the result:
aws eks describe-addon --cluster-name demo --addon-name aws-ebs-csi-driver \
--query 'addon.status'The status moves from CREATING to ACTIVE. If it ends in DEGRADED or CREATE_FAILED, read the addon.health.issues field in the same output.
The --service-account-role-arn option uses IRSA. With EKS Pod Identity, you create a pod identity association for the add-on's service account instead.
Declaring add-ons in eksctl
You can put add-ons in the cluster config so they are part of your declarative setup.
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: demo
region: us-east-1
addons:
- name: vpc-cni
- name: coredns
- name: kube-proxy
- name: eks-pod-identity-agentApply it to an existing cluster with eksctl create addon -f cluster.yaml.
Updating an add-on
Update an add-on with a specific version and a conflict policy. The policy decides what happens when a field was changed by hand.
aws eks update-addon \
--cluster-name demo \
--addon-name coredns \
--addon-version v1.11.3-eksbuild.1 \
--resolve-conflicts PRESERVE| Policy | Behavior |
|---|---|
| `NONE` | The update fails if EKS would change a field you edited. |
| `PRESERVE` | EKS keeps your edited values and updates the rest. |
| `OVERWRITE` | EKS replaces your edits with its defaults. |
Common errors
- Add-on stuck in
CREATINGorDEGRADED. There are often no nodes to schedule pods on. Checkkubectl get pods -n kube-systemand the add-on's health issues. - Permission errors in the add-on's pods. The IAM role is missing, or its trust policy does not match the service account or
pods.eks.amazonaws.com. - Conflict on update. Someone edited the add-on's resources with
kubectl. UsePRESERVE, or move your settings into the add-on's configuration values. - Version not supported. You picked a version that is not listed for your Kubernetes version. Run
describe-addon-versionsagain.
Exercise
You run aws eks update-addon for CoreDNS and it fails because you earlier changed the replica count with kubectl. Which conflict policy keeps your replica count, and what is the better long-term fix?
Show answer
Use --resolve-conflicts PRESERVE. The better fix is to set the replica count through the add-on's configuration values, so EKS manages it and later updates do not conflict.