aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.22k stars 320 forks source link

[EKS] [Addon Update]: Conditional resources Limits/Requests validation for Managed Addon #2213

Open TLPNull opened 1 year ago

TLPNull commented 1 year ago

Community Note

Tell us about your request I am attempting to remove the CPU limit from an EKS managed addon, specifically targeting the coredns managed addon. The challenge I am facing is that in order to remove the limit, I need to overwrite the values. I have found that setting the limit to "0" achieves this. However, during the EKS addon update process, the verification checks if the limits are greater than the request. While this makes sense in general, it becomes an issue when setting the limit to "0" to remove it. The error message I receive is:

Deployment.apps "coredns" is invalid: spec.template.spec.containers[0].resources.requests: Invalid value: "300m": must be less than or equal to cpu limit

Which service(s) is this request for? EKS (Elastic Kubernetes Service)

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I am trying to remove the CPU limit from the coredns managed addon in EKS. The current difficulty lies in the fact that setting the limit to "0" triggers a validation error during the addon update process due to the verification of limits being greater than requests. This becomes a hindrance, especially when the intention is to remove the limit.

Are you currently working around this issue? Currently, there isn't a straightforward workaround for this issue. The proposed fix aims to make the process of removing CPU limits more seamless by addressing the validation checks during addon updates.

Additional context

Additionally, it would be beneficial to extend this modification to add the condition to the verification for memory as well.

This is the Advanced Configuration applied:

{
    "replicaCount": 4,
    "resources": {
        "requests": {
            "cpu": "300m"
        },
        "limits": {
            "cpu": "0"
        }
    }
}

Attachments N/A

gtaber28 commented 1 week ago

I ran into this issue when setting CoreDNS EKS addon resource limits for Fargate instances. It seems there is no default value for cpu limits so you can just specify a cpu request value and no limit:

        resources = {
          limits = {
            memory = ".25Gi"
          }
          requests = {
            cpu    = "250m"
            memory = ".25Gi"
          }
        }