gitlab-system: Also strip CPU requests from init containers.
The Assign only covered spec.containers, so each GitLab pod still
requested 50m through its init containers (effective request is the
larger of the biggest init container and the sum of containers). This
made new pods unschedulable during the 10.5.4 rollout at ~86% CPU
requests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I976662758d63c8ff47cb31613f75b1c414925e08
diff --git a/gitlab-system/no-resource-requests.yaml b/gitlab-system/no-resource-requests.yaml
index 31e146b..db1cdd9 100644
--- a/gitlab-system/no-resource-requests.yaml
+++ b/gitlab-system/no-resource-requests.yaml
@@ -1,8 +1,12 @@
+# GitLab's chart requests far more CPU than this 4-core node can schedule.
+# Set every CPU request in gitlab-system to 1m. A pod's effective request
+# is max(largest init container, sum of containers), so init containers
+# (certificates, configure, dependencies: 50m each by default) need their
+# own mutator; an Assign has exactly one location.
apiVersion: mutations.gatekeeper.sh/v1
kind: Assign
metadata:
name: no-resource-requests
- #namespace: gatekeeper-system
spec:
applyTo:
- groups: [""]
@@ -18,4 +22,23 @@
parameters:
assign:
value: "1m"
-
+---
+apiVersion: mutations.gatekeeper.sh/v1
+kind: Assign
+metadata:
+ name: no-resource-requests-init
+spec:
+ applyTo:
+ - groups: [""]
+ kinds: ["Pod"]
+ versions: ["v1"]
+ match:
+ scope: Namespaced
+ kinds:
+ - apiGroups: ["*"]
+ kinds: ["Pod"]
+ namespaces: ["gitlab-system"]
+ location: "spec.initContainers[name:*].resources.requests.cpu"
+ parameters:
+ assign:
+ value: "1m"