fix(deploy) : fit web CPU reservations to cluster capacity
CI / Verify (push) Successful in 2m48s
CI / Build immutable images and deploy (push) Successful in 10m6s

This commit is contained in:
2026-10-09 19:22:20 +07:00 Unverified
parent be2648cab3
commit 98a6878d59
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -174,6 +174,10 @@ jobs:
kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" patch deployment buzz-sheet \
--type=merge \
--patch '{"spec":{"strategy":{"type":"RollingUpdate","rollingUpdate":{"maxSurge":0,"maxUnavailable":1}}}}'
kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" set resources deployment/buzz-sheet \
--containers=app \
--requests=cpu=200m,memory=1Gi \
--limits=cpu=1,memory=2Gi
kubectl --kubeconfig "$KUBECONFIG" --namespace "$DEPLOY_NAMESPACE" set image \
deployment/buzz-sheet \
app="$REGISTRY_IMAGE:$REVISION"
+1 -1
View File
@@ -169,7 +169,7 @@ spec:
optional: true
resources:
requests:
cpu: 500m
cpu: 200m
memory: 1Gi
limits:
cpu: "1"
+6 -1
View File
@@ -16,7 +16,7 @@ describe("production deployment contract", () => {
expect(deployment.match(/path: \/api\/healthz\n/gu)).toHaveLength(3);
expect(deployment).toContain("kubernetes.io/arch: arm64");
expect(deployment).toMatch(
/requests:\s+cpu: 500m\s+memory: 1Gi\s+limits:\s+cpu: "1"\s+memory: 2Gi/u,
/requests:\s+cpu: 200m\s+memory: 1Gi\s+limits:\s+cpu: "1"\s+memory: 2Gi/u,
);
expect(deployment).toContain("runAsNonRoot: true");
expect(deployment).toContain("runAsUser: 1000");
@@ -148,6 +148,11 @@ describe("production deployment contract", () => {
const patchRolloutStrategy = workflow.indexOf("patch deployment buzz-sheet");
expect(patchRolloutStrategy).toBeGreaterThan(-1);
expect(patchRolloutStrategy).toBeLessThan(workflow.indexOf("set image"));
expect(workflow).toContain("--requests=cpu=200m,memory=1Gi");
expect(workflow).toContain("--limits=cpu=1,memory=2Gi");
const setResources = workflow.indexOf("set resources deployment/buzz-sheet");
expect(setResources).toBeGreaterThan(-1);
expect(setResources).toBeLessThan(workflow.indexOf("set image"));
const deleteMigrationJob = workflow.indexOf(
'delete job buzz-sheet-migrate --ignore-not-found',
);