From 205314e3633b384fd7836a1eafa26552df3f2dd2 Mon Sep 17 00:00:00 2001 From: Hadi Abbasi Date: Thu, 11 Apr 2024 18:45:52 +0330 Subject: [PATCH] set GOMAXPROCS and GOMEMLIMIT vars if applied, set GOMAXPROCS and GOMEMLIMIT for all controllers based on container resources which leads to reduce throttling and better performance Signed-off-by: Hadi Abbasi --- manifests/install/kustomization.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/manifests/install/kustomization.yaml b/manifests/install/kustomization.yaml index edce8ca8..f1eabdc6 100644 --- a/manifests/install/kustomization.yaml +++ b/manifests/install/kustomization.yaml @@ -26,3 +26,23 @@ images: newName: ghcr.io/fluxcd/image-reflector-controller - name: fluxcd/image-automation-controller newName: ghcr.io/fluxcd/image-automation-controller +patches: + - patch: | + - op: add + path: /spec/template/spec/containers/0/env/- + value: + name: GOMAXPROCS + valueFrom: + resourceFieldRef: + containerName: manager + resource: limits.cpu + - op: add + path: /spec/template/spec/containers/0/env/- + value: + name: GOMEMLIMIT + valueFrom: + resourceFieldRef: + containerName: manager + resource: limits.memory + target: + kind: Deployment