Sub topic 9
Managing Cluster Add-ons
This chapter assumes you have created a cluster with eksctl, know how the VPC CNI places pod IPs in your subnets, and have used kubectl and the AWS CLI. You should also know the difference between IRSA and EKS Pod Identity from the previous chapter.
What an add-on is
A new EKS cluster needs more than a control plane and nodes. Pods must get IP addresses, service names must resolve, and Service traffic must be routed. Operational features such as storage and observability depend on extra software running in the cluster. That software is a set of ordinary Kubernetes workloads, usually Deployments and DaemonSets in kube-system.
An Amazon EKS add-on is one of these workloads, packaged and versioned by AWS, and installed and updated through the EKS API instead of through kubectl apply or Helm. The EKS API tracks its version, health and configuration, and checks that the version works with your Kubernetes version.
Common add-ons:
| Add-on name | What it does | Needs an IAM role? |
|---|---|---|
| `vpc-cni` | Assigns VPC IP addresses to pods | Yes, on the `aws-node` service account (the node role works but is not recommended) |
| `coredns` | Cluster DNS | No |
| `kube-proxy` | Programs Service routing rules on each node | No |
| `eks-pod-identity-agent` | Delivers Pod Identity credentials to pods | No |
| `aws-ebs-csi-driver` | Provisions EBS volumes | Yes |
| `aws-efs-csi-driver` | Mounts EFS file systems | Yes |
| `amazon-cloudwatch-observability` | CloudWatch agent and Fluent Bit for Container Insights | Yes |
| `metrics-server` | Resource metrics for `kubectl top` and the HPA | No |
The exact list changes over time. Ask the API what exists for your Kubernetes version:
aws eks describe-addon-versions \
--kubernetes-version 1.31 \
--query 'addons[].addonName' \
--output textAdd-on types and ownership
Three sources of cluster software are easy to confuse:
- AWS add-ons are built and published by AWS. Most have no extra charge beyond the compute they use.
- AWS Marketplace add-ons come from third-party vendors through EKS. They can carry license fees.
- Self-managed software is anything you install with Helm or manifests, including a self-managed copy of an add-on such as
vpc-cni.
Every cluster runs vpc-cni, coredns and kube-proxy. Depending on how the cluster was created, they may be self-managed or EKS add-ons. Check before you assume:
aws eks list-addons --cluster-name demoIf a name is missing from the output but its pods run in kube-system, that copy is self-managed. You can adopt it into the EKS API by creating the add-on with the same name. That is where conflict handling matters.
The add-on lifecycle
An add-on moves through a small set of statuses, which you can read with aws eks describe-addon.
DEGRADED means the add-on is installed but its pods are unhealthy. The health.issues field in the describe-addon output gives the reason, which is usually a missing permission or a pod that cannot be scheduled.
Installing an add-on
Use the EBS CSI driver as an example. It needs AWS permissions, so you pass an IAM role. The role below is assumed to exist already, with AmazonEBSCSIDriverPolicy attached and a trust policy for the ebs-csi-controller-sa service account (IRSA) or for pods.eks.amazonaws.com (Pod Identity).
aws eks create-addon \
--cluster-name demo \
--addon-name aws-ebs-csi-driver \
--service-account-role-arn arn:aws:iam::111122223333:role/ebs-csi-role
aws eks wait addon-active \
--cluster-name demo \
--addon-name aws-ebs-csi-driver
aws eks describe-addon \
--cluster-name demo \
--addon-name aws-ebs-csi-driver \
--query 'addon.[status,addonVersion]'If you omit --addon-version, EKS installs the default version for your Kubernetes version. That is not always the newest. Pin a version explicitly when you need reproducible clusters.
You can also declare add-ons in the eksctl config, so they are created together with the cluster:
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: demo
region: us-east-1
iam:
withOIDC: true
addons:
- name: vpc-cni
- name: coredns
- name: kube-proxy
- name: eks-pod-identity-agent
- name: aws-ebs-csi-driver
wellKnownPolicies:
ebsCSIController: true
managedNodeGroups:
- name: ng-1
instanceType: m5.large
desiredCapacity: 2
minSize: 1
maxSize: 4Here iam.withOIDC: true creates the OIDC provider that IRSA needs. wellKnownPolicies.ebsCSIController makes eksctl create the IAM role for the driver. Add-ons declared this way are applied with eksctl create cluster -f or, on an existing cluster, eksctl create addon -f.
Configuring an add-on
Each add-on publishes a JSON schema of the settings EKS lets you change. View it before you edit anything:
aws eks describe-addon-configuration \
--addon-name coredns \
--addon-version v1.11.3-eksbuild.1 \
--query 'configurationSchema' --output textReplace the version with one returned by describe-addon-versions for your cluster. Then apply values through --configuration-values:
aws eks update-addon \
--cluster-name demo \
--addon-name coredns \
--configuration-values '{"replicaCount":3}'Settings for vpc-cni go under an env key, for example {"env":{"ENABLE_PREFIX_DELEGATION":"true"}}.
Conflicts with manual edits
EKS applies add-on configuration with Kubernetes server-side apply. If you changed a field with kubectl edit and EKS now wants to own that field, the operation hits a conflict. The --resolve-conflicts option decides what happens:
| Value | Effect |
|---|---|
| `OVERWRITE` | EKS replaces your value with its own. |
| `NONE` | EKS leaves your value alone and the operation fails if it conflicts. |
| `PRESERVE` | On update only. EKS keeps your value and does not change that field. |
Use NONE first so you see what would be lost. Switch to OVERWRITE only after you have recorded the manual changes you want to keep. Move those settings into --configuration-values so EKS manages them.
Updating and removing add-ons
Add-on versions follow their own numbering, such as v1.11.3-eksbuild.1, and are compatible with a range of Kubernetes versions. List the compatible ones, then update:
aws eks describe-addon-versions \
--addon-name aws-ebs-csi-driver \
--kubernetes-version 1.31 \
--query 'addons[0].addonVersions[].addonVersion'
aws eks update-addon \
--cluster-name demo \
--addon-name aws-ebs-csi-driver \
--addon-version v1.35.0-eksbuild.1 \
--resolve-conflicts NONEThe version string above is an example. Use one from your own listing. Two rules apply:
- Update the control plane first, then the add-ons. The next-but-one chapter on upgrades builds on this order.
- Move
vpc-cnione minor version at a time. Skipping minor versions can break pod networking.
To remove an add-on from EKS but keep its running pods, add --preserve to aws eks delete-addon. The workload then becomes self-managed.
Common errors
- Add-on stuck in
CREATINGorDEGRADEDon a new cluster.corednsand the CSI controllers need nodes. Create a node group first, or check that your Fargate profile matches thekube-systempods. CREATE_FAILEDwith a conflict message. A self-managed copy already exists with different settings. Retry withOVERWRITEafter you review the differences.- PVCs stay
Pendingafter installing the EBS CSI driver. The controller has no IAM permissions. Checkdescribe-addonfor the role and look at theebs-plugincontainer logs forUnauthorizedOperationerrors. eks-pod-identity-agentmissing credentials on Fargate. The agent runs as a DaemonSet, so it does not run on Fargate. Use IRSA for Fargate pods.- Your
kubectl editchange disappears after an update. EKS reapplied its configuration. Put the setting in--configuration-values.
Exercise
You run kubectl edit deployment coredns -n kube-system and set 4 replicas. A week later, aws eks update-addon for CoreDNS returns a conflict error. What caused it, and how do you fix it so it does not recur?
Show answer
Your manual edit changed a field that EKS also manages, so server-side apply reports a conflict. Run the update with --resolve-conflicts NONE first to see the failure, then set the replica count through --configuration-values '{"replicaCount":4}'. EKS now owns that value, and future updates keep it.
Exercise
A cluster has aws-ebs-csi-driver in status DEGRADED, and a PVC is stuck in Pending. Which two places do you check first?
Show answer
Check aws eks describe-addon and read health.issues. Then check the logs of the ebs-plugin container in the ebs-csi-controller pods. Both usually point to a missing or wrongly trusted IAM role.