1
0
mirror of https://github.com/google/nomulus synced 2026-05-21 23:31:51 +00:00

Add canary strategy to crash stage in Cloud Deploy pipeline (#3057)

* Add customCanaryDeployment strategy to crash

* change key to partialDeploymentAlertPolicyChecks

* add more indentation to alert policies config
This commit is contained in:
Juan Celhay
2026-05-21 15:39:46 -04:00
committed by GitHub
parent 73725e94fe
commit bd70cd91a5
3 changed files with 66 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ steps:
/^stableDeploymentAlertPolicyChecks:/ { capture = 1; next }
capture {
if ($0 ~ /^[^[:space:]]/ && $0 != "") { capture = 0; exit }
print " " $0
print " " $0
}
' "$config_file" > checks.tmp
@@ -55,6 +55,23 @@ steps:
sed -i '/stableDeploymentAlertPolicyChecks/r checks.tmp' release/clouddeploy/delivery-pipeline.yaml
sed -i '/stableDeploymentAlertPolicyChecks/d' release/clouddeploy/delivery-pipeline.yaml
rm -f checks.tmp
# Extract only the indented block under partialDeploymentAlertPolicyChecks.
if grep -q "^partialDeploymentAlertPolicyChecks:" "$config_file"; then
echo "Extracting partial checks from $config_file..."
awk '
/^partialDeploymentAlertPolicyChecks:/ { capture = 1; next }
capture {
if ($0 ~ /^[^[:space:]]/ && $0 != "") { capture = 0; exit }
print " " $0
}
' "$config_file" > partial_checks.tmp
# Insert the checks where the placeholder is located and remove the placeholder
sed -i '/partialDeploymentAlertPolicyChecks/r partial_checks.tmp' release/clouddeploy/delivery-pipeline.yaml
sed -i '/partialDeploymentAlertPolicyChecks/d' release/clouddeploy/delivery-pipeline.yaml
rm -f partial_checks.tmp
fi
# Populate variables in target file
target_file="release/clouddeploy/${env}-target.yaml"

View File

@@ -7,13 +7,34 @@ description: deploy-nomulus is a Cloud native replacement for Spinnaker that ena
serialPipeline:
stages:
- targetId: crash
profiles:
- crash
strategy:
standard:
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
stableDeploymentAlertPolicyChecks
canary:
customCanaryDeployment:
phaseConfigs:
- phaseId: "canary-1"
profiles: ["crash-partial-phase-1"]
percentage: 10
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
partialDeploymentAlertPolicyChecks
- phaseId: "canary-5"
profiles: ["crash-partial-phase-5"]
percentage: 50
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
partialDeploymentAlertPolicyChecks
- phaseId: "stable"
profiles: ["crash"]
percentage: 100
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
stableDeploymentAlertPolicyChecks

View File

@@ -11,5 +11,23 @@ profiles:
- ../jetty/kubernetes/nomulus-crash-console.yaml
- ../jetty/kubernetes/nomulus-crash-frontend.yaml
- ../jetty/kubernetes/nomulus-crash-pubapi.yaml
deploy:
kubectl: { }
- name: crash-partial-phase-1
manifests:
rawYaml:
- ../jetty/kubernetes/nomulus-crash-backend-partial-phase-1.yaml
- ../jetty/kubernetes/nomulus-crash-console-partial-phase-1.yaml
- ../jetty/kubernetes/nomulus-crash-frontend-partial-phase-1.yaml
- ../jetty/kubernetes/nomulus-crash-pubapi-partial-phase-1.yaml
deploy:
kubectl: { }
- name: crash-partial-phase-5
manifests:
rawYaml:
- ../jetty/kubernetes/nomulus-crash-backend-partial-phase-5.yaml
- ../jetty/kubernetes/nomulus-crash-console-partial-phase-5.yaml
- ../jetty/kubernetes/nomulus-crash-frontend-partial-phase-5.yaml
- ../jetty/kubernetes/nomulus-crash-pubapi-partial-phase-5.yaml
deploy:
kubectl: { }