GKE Autopilot changes the limits/requests resources of a pod in a wrong way
Asked Answered
P

2

9

When I launch a pod with the following limits/request:

    resources:
  limits:
    cpu: "3500m"
    memory: "8192Mi"
    ephemeral-storage: "5Gi"
  requests:
    cpu: "500m"
    memory: "512Mi"
    ephemeral-storage: "2Gi"

Autopilot modifies the resources limits and set them equals to the request ones:

autopilot.gke.io/resource-adjustment: {"input":{"containers":[{"limits":{"cpu":"3500m","ephemeral-storage":"5Gi","memory":"8Gi"},"requests":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"512Mi"},"name":"prueba-init-container"}]},"output":{"containers":[{"limits":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"512Mi"},"requests":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"512Mi"},"name":"prueba-init-container"}]},"modified":true} seccomp.security.alpha.kubernetes.io/pod: runtime/default

Pluto answered 7/12, 2021 at 10:59 Comment(0)
O
14

Resource limits need to be equal to requested resources for GKE autopilot

That is the default behavior of the GKE autopilot. Read More

Perhaps, this restriction is to make it easier for Google to bill you better, with GKE Autopilot, you lose the ability to set a resource limit higher than the requested CPU and memory resources.

You need to ensure that you give from the start enough resources to your pod, no less, no more.

This is not a mistake. If you try to set a higher limit, GKE Autopilot will just override your limit and make it equal to the requested value.

Resource limits

In an Autopilot cluster, each Pod is treated as a Guaranteed QoS Class Pod, with limits that are equal to requests. Autopilot automatically sets resource limits equal to requests if you do not have resource limits specified. If you do specify resource limits, your limits will be overridden and set to be equal to the requests.

Outgoing answered 7/12, 2021 at 11:29 Comment(1)
Support was announced later on though: cloud.google.com/blog/products/containers-kubernetes/…Jesher
J
0

Google announced support for Burstable workloads on Autopilot here:

https://cloud.google.com/blog/products/containers-kubernetes/introducing-gke-autopilot-burstable-workloads

There are a few details not to miss here:

https://cloud.google.com/kubernetes-engine/docs/how-to/pod-bursting-gke#availability-in-gke

Jesher answered 13/8, 2024 at 13:0 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.