From 587eafb83c30f2ca8422def696a7278fbb229fa5 Mon Sep 17 00:00:00 2001 From: Dima Prediger Date: Tue, 30 Jun 2026 17:47:37 +0200 Subject: [PATCH] ci: use pod-level Kubernetes resource variables Replace per-container KUBERNETES_CPU_REQUEST / KUBERNETES_MEMORY_* with pod-level KUBERNETES_POD_* vars in both tier_m and tier_l anchors. Two native-image Gradle builds are updated to read the renamed env var for CPU parallelism sizing. Behavior changes: - Resources now budget the full pod (build + helper + init containers share a single quota) instead of only the build container, reducing the effective per-job cluster footprint. - KUBERNETES_POD_CPU_LIMIT added (no CPU limit existed before); jobs lose burst headroom in exchange for tighter scheduling isolation. Tier_m: 6 CPU / 16Gi. Tier_l: 10 CPU / 20Gi. Feature flag ci.gitlab-runner.enable-pod-level-resources (rule v3) must be enabled for this repo before merging to master. Draft PR opened for pod-spec validation on the flag-enabled branch first. Refs: CIEXE-2021, CIEXE-2150 --- .gitlab-ci.yml | 14 ++++++++------ .../quarkus-native/application/build.gradle | 2 +- .../application/build.gradle | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1937d97cc70..c4d758ab258 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -170,18 +170,20 @@ default: GRADLE_WORKERS: 4 GRADLE_MEMORY_MIN: 1G GRADLE_MEMORY_MAX: 5G - KUBERNETES_CPU_REQUEST: 6 - KUBERNETES_MEMORY_REQUEST: 16Gi - KUBERNETES_MEMORY_LIMIT: 16Gi + KUBERNETES_POD_CPU_REQUEST: 6 + KUBERNETES_POD_CPU_LIMIT: 6 + KUBERNETES_POD_MEMORY_REQUEST: 16Gi + KUBERNETES_POD_MEMORY_LIMIT: 16Gi .tier_l: variables: &tier_l_variables GRADLE_WORKERS: 6 GRADLE_MEMORY_MIN: 1G GRADLE_MEMORY_MAX: 6G - KUBERNETES_CPU_REQUEST: 10 - KUBERNETES_MEMORY_REQUEST: 20Gi - KUBERNETES_MEMORY_LIMIT: 20Gi + KUBERNETES_POD_CPU_REQUEST: 10 + KUBERNETES_POD_CPU_LIMIT: 10 + KUBERNETES_POD_MEMORY_REQUEST: 20Gi + KUBERNETES_POD_MEMORY_LIMIT: 20Gi .gitlab_base_ref_params: &gitlab_base_ref_params - | diff --git a/dd-smoke-tests/quarkus-native/application/build.gradle b/dd-smoke-tests/quarkus-native/application/build.gradle index 65beb08e810..63373c9a51c 100644 --- a/dd-smoke-tests/quarkus-native/application/build.gradle +++ b/dd-smoke-tests/quarkus-native/application/build.gradle @@ -17,7 +17,7 @@ version = "" // Avoid unlimited CPU usage on CI. def isCI = providers.environmentVariable("CI").isPresent() -def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_CPU_REQUEST").getOrElse("4") +def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_POD_CPU_REQUEST").getOrElse("4") dependencies { implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") diff --git a/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle b/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle index 08545cf1e16..8500a245453 100644 --- a/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle @@ -15,7 +15,7 @@ ext.withProfiler = hasProperty('profiler') // Avoid unlimited CPU usage on CI. def isCI = providers.environmentVariable("CI").isPresent() -def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_CPU_REQUEST").getOrElse("4") +def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_POD_CPU_REQUEST").getOrElse("4") if (hasProperty('appBuildDir')) { buildDir = property('appBuildDir')