fix(deploy) : fit web CPU reservations to cluster capacity
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -169,7 +169,7 @@ spec:
|
||||
optional: true
|
||||
resources:
|
||||
requests:
|
||||
cpu: 500m
|
||||
cpu: 200m
|
||||
memory: 1Gi
|
||||
limits:
|
||||
cpu: "1"
|
||||
|
||||
@@ -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',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user