Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update serverless clusters running EKS Farage to maximize resource utilization on CoreDNS #1329

Merged
merged 2 commits into from
Jan 13, 2023

Conversation

bryantbiggs
Copy link
Contributor

What does this PR do?

  • Update serverless clusters running EKS Farage to maximize resource utilization on CoreDNS

Motivation

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I have added a new example under examples to support my PR
  • Yes, I have created another PR for add-ons under add-ons repo (if applicable)
  • Yes, I have updated the docs for this feature
  • Yes, I ran pre-commit run -a with this PR

Note: Not all the PRs require a new example and/or doc page. In general:

  • Use an existing example when possible to demonstrate a new addons usage
  • A new docs page under docs/add-ons/* is required for new a new addon

For Moderators

  • E2E Test successfully complete before merge?

Additional Notes

@bryantbiggs bryantbiggs requested a review from a team as a code owner January 13, 2023 01:42
@bryantbiggs bryantbiggs temporarily deployed to EKS Blueprints Test January 13, 2023 01:42 — with GitHub Actions Inactive
@@ -53,6 +53,18 @@ module "eks" {
coredns = {
configuration_values = jsonencode({
computeType = "Fargate"
# Ensure that the we fully utilize the minimum amount of resources that are supplied by
# Fargate https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is good to include this other link https://docs.aws.amazon.com/eks/latest/userguide/fargate-pod-configuration.html
Don't know if you want to add this link or replace the current one with this one.

This one shows that 256MB are being reserved for kubelet, kube-proxy, containerd

Fargate adds 256 MB to each pod's memory reservation for the required Kubernetes components (kubelet, kube-proxy, and containerd).
Fargate rounds up to the following compute configuration that most closely matches the sum of vCPU and memory requests in order to ensure pods always have the resources that they need to run.

And also provides an example

The additional memory reserved for the Kubernetes components can cause a Fargate task with more vCPUs than requested to be provisioned. For example, a request for 1 vCPU and 8 GB memory will have 256 MB added to its memory request, and will provision a Fargate task with 2 vCPUs and 9 GB memory, since no task with 1 vCPU and 9 GB memory is available.

@csantanapr
Copy link
Contributor

csantanapr commented Jan 13, 2023

Just thinking out loud, I think having this as tip and script/tool to scanned a cluster using fargate and calculate total waste of resources. This can be a cost and performance optimization tip/script during evaluation of a cluster config.

@bryantbiggs bryantbiggs temporarily deployed to EKS Blueprints Test January 13, 2023 14:49 — with GitHub Actions Inactive
Copy link
Contributor

@csantanapr csantanapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@bryantbiggs
Copy link
Contributor Author

looks good now

Labels:               eks.amazonaws.com/component=coredns
                      eks.amazonaws.com/fargate-profile=kube-system-2a
                      k8s-app=kube-dns
                      pod-template-hash=6f984dc4dc
Annotations:          CapacityProvisioned: 0.25vCPU 0.5GB # <= Smallest capacity provisioned
                      Logging: LoggingDisabled: LOGGING_CONFIGMAP_NOT_FOUND
                      eks.amazonaws.com/compute-type: Fargate
                      kubernetes.io/psp: eks.privileged
Status:               Running
IP:                   10.0.10.100
IPs:
  IP:           10.0.10.100
Controlled By:  ReplicaSet/coredns-6f984dc4dc
Containers:
  coredns:
    Container ID:  containerd://51755a6101eef18147e8a529ee0f84996f4d227bdec917277c659dd4c4b576a2
    Image:         602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/coredns:v1.8.7-eksbuild.3
    Image ID:      602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/coredns@sha256:871a47b5773bbde084c8e9f12e4321a168ddd578521ffae8b55b3dd982ddc66a
    Ports:         53/UDP, 53/TCP, 9153/TCP
    Host Ports:    0/UDP, 0/TCP, 0/TCP
    Args:
      -conf
      /etc/coredns/Corefile
    State:          Running
      Started:      Fri, 13 Jan 2023 10:22:55 -0500
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     250m # <= Using all of available CPU for smallest capacity
      memory:  256M # <= Using all of the available memory for the smallest capacity *AFTER account for overhead
    Requests:
      cpu:     250m # <= Using all of available CPU for smallest capacity
      memory:  256M # <= Using all of the available memory for the smallest capacity *AFTER account for overhead

@bryantbiggs bryantbiggs merged commit ed0707a into main Jan 13, 2023
@bryantbiggs bryantbiggs deleted the feat/update-fargate-examples branch January 13, 2023 16:38
vara-bonthu pushed a commit that referenced this pull request Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fargate-serverless example launches CoreDNS pods with request/limits below the minimum Fargate values
2 participants