mirror of
https://github.com/google/nomulus
synced 2026-09-20 15:04:24 +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:
@@ -47,7 +47,7 @@ steps:
|
|||||||
/^stableDeploymentAlertPolicyChecks:/ { capture = 1; next }
|
/^stableDeploymentAlertPolicyChecks:/ { capture = 1; next }
|
||||||
capture {
|
capture {
|
||||||
if ($0 ~ /^[^[:space:]]/ && $0 != "") { capture = 0; exit }
|
if ($0 ~ /^[^[:space:]]/ && $0 != "") { capture = 0; exit }
|
||||||
print " " $0
|
print " " $0
|
||||||
}
|
}
|
||||||
' "$config_file" > checks.tmp
|
' "$config_file" > checks.tmp
|
||||||
|
|
||||||
@@ -55,6 +55,23 @@ steps:
|
|||||||
sed -i '/stableDeploymentAlertPolicyChecks/r checks.tmp' release/clouddeploy/delivery-pipeline.yaml
|
sed -i '/stableDeploymentAlertPolicyChecks/r checks.tmp' release/clouddeploy/delivery-pipeline.yaml
|
||||||
sed -i '/stableDeploymentAlertPolicyChecks/d' release/clouddeploy/delivery-pipeline.yaml
|
sed -i '/stableDeploymentAlertPolicyChecks/d' release/clouddeploy/delivery-pipeline.yaml
|
||||||
rm -f checks.tmp
|
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
|
# Populate variables in target file
|
||||||
target_file="release/clouddeploy/${env}-target.yaml"
|
target_file="release/clouddeploy/${env}-target.yaml"
|
||||||
|
|||||||
@@ -7,13 +7,34 @@ description: deploy-nomulus is a Cloud native replacement for Spinnaker that ena
|
|||||||
serialPipeline:
|
serialPipeline:
|
||||||
stages:
|
stages:
|
||||||
- targetId: crash
|
- targetId: crash
|
||||||
profiles:
|
|
||||||
- crash
|
|
||||||
strategy:
|
strategy:
|
||||||
standard:
|
canary:
|
||||||
analysis:
|
customCanaryDeployment:
|
||||||
# 10 minutes.
|
phaseConfigs:
|
||||||
duration: 600s
|
- phaseId: "canary-1"
|
||||||
googleCloud:
|
profiles: ["crash-partial-phase-1"]
|
||||||
alertPolicyChecks:
|
percentage: 10
|
||||||
stableDeploymentAlertPolicyChecks
|
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
|
||||||
|
|||||||
@@ -11,5 +11,23 @@ profiles:
|
|||||||
- ../jetty/kubernetes/nomulus-crash-console.yaml
|
- ../jetty/kubernetes/nomulus-crash-console.yaml
|
||||||
- ../jetty/kubernetes/nomulus-crash-frontend.yaml
|
- ../jetty/kubernetes/nomulus-crash-frontend.yaml
|
||||||
- ../jetty/kubernetes/nomulus-crash-pubapi.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:
|
deploy:
|
||||||
kubectl: { }
|
kubectl: { }
|
||||||
Reference in New Issue
Block a user