[EKS] [managed addons]: failed managed add-on update and recovery behavior
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
We use Terraform to manage addons, as detailed at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon.
This resource has its own timeout, which is 20 minutes for updates by default. If I introduce an intentional bug into the addon configuration (in my case, it's CoreDNS), for instance, by setting the CPU request to 100 and performing a Terraform apply, at some point it will fail with...
```
aws_eks_addon.this[0]: Still modifying... [id=my-eks:coredns, 19m50s elapsed]
aws_eks_addon.this[0]: Still modifying... [id=my-eks:coredns, 20m0s elapsed]
╷
│ Error: error waiting for EKS Add-On (my-eks:coredns) update (c4a9871f-a603-3ff0-982d-b314692c00f0): timeout while waiting for state to become 'Successful' (last state: 'InProgress', timeout: 20m0s)
│
│ with aws_eks_addon.this[0],
│ on main.tf line 10, in resource "aws_eks_addon" "this":
│ 10: resource "aws_eks_addon" "this" {
│
```
then I implement a bugfix (set cpu to 100m) and run `terraform apply` to correct configuration
but undortuantelly it fails with new error:
```
aws_eks_addon.this[0]: Modifying... [id=my-eks:coredns]
╷
│ Error: error updating EKS Add-On (my-eks:coredns): ResourceInUseException: Addon coredns cannot be updated as it is currently in UPDATING state
│ {
│ RespMetadata: {
│ StatusCode: 409,
│ RequestID: "375e203a-e2af-4777-9f68-09970b0383"
│ },
│ AddonName: "coredns",
│ ClusterName: "my-eks",
│ Message_: "Addon coredns cannot be updated as it is currently in UPDATING state"
│ }
│
│ with aws_eks_addon.this[0],
│ on main.tf line 10, in resource "aws_eks_addon" "this":
│ 10: resource "aws_eks_addon" "this" {
```
I can see that the Addon management update ID is still in progress. There are still pending pods on my cluster due to the configuration bug, which involves a 100 CPU request that can't be satisfied.
The only workaround for this is to log into the cluster and manually update the addon configuration using kubectl, or wait an unknown amount of time for the addon management to fail.
**Which service(s) is this request for?**
EKS managed addons
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Addon management should be able to determine if the configuration of the underlying deployment or daemonset is incorrect, or it should have a known timeout after which it will not continue to wait. This process should not require manual intervention.
**Are you currently working around this issue?**
Fix addon config using kubectl or wait (very long time) for update to fail and update using terraform/api call again
Contributor guide
Research direction
Start by reproducing the EKS managed add-on update through the Terraform aws_eks_addon resource, using the CoreDNS configuration and timeout shown in the report. Observe the transition from an update timeout to ResourceInUseException and compare the available Terraform or API recovery paths. Done should mean a failed update reaches a known terminal state and can be corrected without manual kubectl intervention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, kubernetes, terraform
- Domain
- cloud, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100