Add prod target to Cloud Deploy pipeline (#3216)

* add production target to cloud deploy

* revert unnecesary readme changes
This commit is contained in:
Juan Celhay
2026-08-24 18:58:45 +00:00
committed by GitHub
parent 7b34f3c85a
commit f6b763fe4f
5 changed files with 136 additions and 2 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ steps:
- -c
- |
set -e
for env in crash sandbox; do
for env in crash sandbox production; do
config_file="release/clouddeploy/${env}-config.yaml"
if [ -f "$config_file" ]; then
echo "Extracting checks from $config_file..."
@@ -100,7 +100,7 @@ steps:
- -c
- |
set -e
for env in crash sandbox; do
for env in crash sandbox production; do
target_file="release/clouddeploy/${env}-target.yaml"
if [ -f "$target_file" ]; then
echo "Applying target $target_file..."
+1
View File
@@ -287,6 +287,7 @@ steps:
awk 'NR==1,/^---$/ {if ($0 != "---") print}' ./jetty/kubernetes/nomulus-${env}-epp-server.yaml | \
sed s/name:\ epp-server/name:\ epp-server-partial-phase/g | \
sed s/service:\ epp-server/deployment:\ epp-server-partial-phase/g | \
sed s/value:\ epp-server/value:\ epp-server-partial-phase/g | \
sed "/^spec:$/a\ replicas: ${stage}" \
> ./jetty/kubernetes/nomulus-${env}-epp-server-partial-phase-${stage}.yaml
done
@@ -136,6 +136,78 @@ serialPipeline:
googleCloud:
alertPolicyChecks:
sandboxStableDeploymentAlertPolicyChecks
- targetId: production
strategy:
canary:
customCanaryDeployment:
phaseConfigs:
- phaseId: "canary-1"
profiles: ["production-partial-phase-1"]
percentage: 10
predeploy:
tasks:
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-verify-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-verify-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
productionPartialDeploymentAlertPolicyChecks
- phaseId: "canary-5"
profiles: ["production-partial-phase-5"]
percentage: 50
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
productionPartialDeploymentAlertPolicyChecks
- phaseId: "stable"
profiles: ["production"]
percentage: 100
postdeploy:
tasks:
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
DEPLOYED_IMAGE: ${{ deploy_params['deployed_image'] }}
BASE_IMAGE: ${{ deploy_params['base_image'] }}
TARGET_ID: ${{ target.id }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud container images add-tag $DEPLOYED_IMAGE \
${BASE_IMAGE}:live-cd-${TARGET_ID} --quiet
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-deploy-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-deploy-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
productionStableDeploymentAlertPolicyChecks
---
apiVersion: deploy.cloud.google.com/v1
kind: Automation
@@ -148,6 +220,7 @@ selector:
targets:
- id: crash
- id: sandbox
- id: production
rules:
- advanceRolloutRule:
id: advance-canary-phases
@@ -0,0 +1,30 @@
apiVersion: deploy.cloud.google.com/v1
kind: Target
metadata:
name: production
requireApproval: true
executionConfigs:
- usages:
- PREDEPLOY
- RENDER
- ANALYSIS
- POSTDEPLOY
executionTimeout: 3600s
defaultPool:
# Placeholder: Replace with artifact bucket name.
artifactStorage: artifactStorage
# Placeholder: Replace with project number.
serviceAccount: serviceAccount
- usages:
- DEPLOY
executionTimeout: 3600s
privatePool:
# Placeholder: Replace with worker pool name.
workerPool: workerPool
# Placeholder: Replace with artifact bucket name.
artifactStorage: artifactStorage
# Placeholder: Replace with project number.
serviceAccount: serviceAccount
gke:
# Placeholder: Replace with project ID, location, and cluster name.
cluster: cluster
+30
View File
@@ -62,5 +62,35 @@ profiles:
- ../../jetty/kubernetes/nomulus-sandbox-frontend-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-sandbox-pubapi-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-sandbox-epp-server-partial-phase-5.yaml
deploy:
kubectl: { }
- name: production
manifests:
rawYaml:
- ../../jetty/kubernetes/nomulus-production-backend.yaml
- ../../jetty/kubernetes/nomulus-production-console.yaml
- ../../jetty/kubernetes/nomulus-production-frontend.yaml
- ../../jetty/kubernetes/nomulus-production-pubapi.yaml
- ../../jetty/kubernetes/nomulus-production-epp-server.yaml
deploy:
kubectl: { }
- name: production-partial-phase-1
manifests:
rawYaml:
- ../../jetty/kubernetes/nomulus-production-backend-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-console-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-frontend-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-pubapi-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-epp-server-partial-phase-1.yaml
deploy:
kubectl: { }
- name: production-partial-phase-5
manifests:
rawYaml:
- ../../jetty/kubernetes/nomulus-production-backend-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-console-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-frontend-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-pubapi-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-epp-server-partial-phase-5.yaml
deploy:
kubectl: { }