feat(env): Add automatic memory limit handling#650
Conversation
|
cc @EItanya PTAL |
EItanya
left a comment
There was a problem hiding this comment.
So I've been thinking about this PR and your previous one a little more, and I think they may be overkill tbh. I've used the following approach before which has been super simple and worked well.
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: "1"
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
resource: limits.cpu
divisor: "1"
Here it is in Istio: https://github.com/istio/istio/blob/b6df261b7c9f66c10b0d17b02f9c9b9ebb546033/manifests/charts/istio-control/istio-discovery/templates/deployment.yaml#L209-L218
|
thanks @EItanya This method is also effective. However, there is a drawback: under |
ab47997 to
95cd178
Compare
|
3539316 to
8d47371
Compare
Signed-off-by: dongjiang <dongjiang1989@126.com>
8d47371 to
d2b3a4c
Compare
I don't think thats true. a VPA change triggers a new pod, which will have a freshly computed value. I agree with @EItanya on the approach |
It might be that my description wasn't clear enough. When a VPA change with in place pod resize. |
|
you are referring to https://kubernetes.io/blog/2025/05/16/kubernetes-v1-33-in-place-pod-resize-beta/ yeah? Given we are only calling SetMemLimit, if the memory limit actually does change during the pod lifetime, this change won't handle it either...? |
|
closing for stale |
add auto GOMEMLIMIT setting