mirror of
https://github.com/google/nomulus
synced 2026-07-29 11:32:48 +00:00
Expose EPP via saidcar proxy (#2680)
This commit is contained in:
@@ -58,6 +58,8 @@ apt-get install postgresql-client-17 procps -y
|
||||
# Install gcloud
|
||||
apt-get install google-cloud-cli -y
|
||||
apt-get install google-cloud-sdk-app-engine-java -y
|
||||
apt-get install kubectl -y
|
||||
apt-get install google-cloud-cli-gke-gcloud-auth-plugin -y
|
||||
|
||||
# Install git
|
||||
apt-get install git -y
|
||||
|
||||
@@ -198,6 +198,7 @@ artifacts:
|
||||
- 'release/cloudbuild-delete-*.yaml'
|
||||
- 'release/cloudbuild-schema-deploy-*.yaml'
|
||||
- 'release/cloudbuild-schema-verify-*.yaml'
|
||||
- 'release/cloudbuild-restart-proxies-*.yaml'
|
||||
- 'jetty/kubernetes/*.yaml'
|
||||
- 'jetty/kubernetes/gateway/*.yaml'
|
||||
# The images are already uploaded, but we still need to include them there so that
|
||||
|
||||
@@ -88,6 +88,7 @@ steps:
|
||||
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-schema-deploy.yaml
|
||||
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-schema-verify.yaml
|
||||
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-delete.yaml
|
||||
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-restart-proxies.yaml
|
||||
sed -i s/GCP_PROJECT/${PROJECT_ID}/ proxy/kubernetes/proxy-*.yaml
|
||||
sed -i s/'$${TAG_NAME}'/${TAG_NAME}/g release/cloudbuild-sync-and-tag.yaml
|
||||
sed -i s/'$${TAG_NAME}'/${TAG_NAME}/g release/cloudbuild-deploy.yaml
|
||||
@@ -99,6 +100,11 @@ steps:
|
||||
> release/cloudbuild-deploy-gke-${environment}.yaml
|
||||
sed s/'$${_ENV}'/${environment}/g release/cloudbuild-delete.yaml \
|
||||
> release/cloudbuild-delete-${environment}.yaml
|
||||
sed s/'$${_ENV}'/${environment}/g release/cloudbuild-restart-proxies.yaml \
|
||||
> release/cloudbuild-restart-proxies-${environment}.yaml
|
||||
sed s/'$${_ENV}'/${environment}/g release/cloudbuild-restart-proxies.yaml | \
|
||||
sed s/proxy-deployment/proxy-deployment-canary/g \
|
||||
> release/cloudbuild-restart-proxies-${environment}-canary.yaml
|
||||
done
|
||||
# Build and upload the schema_deployer image.
|
||||
- name: 'gcr.io/cloud-builders/docker'
|
||||
@@ -178,11 +184,13 @@ steps:
|
||||
base_domain=$(grep baseDomain \
|
||||
./core/src/main/java/google/registry/config/files/nomulus-config-${env}.yaml | \
|
||||
awk '{print $2}')
|
||||
for service in frontend backend pubapi console
|
||||
for service in frontend backend pubapi console
|
||||
do
|
||||
# non-canary
|
||||
sed s/GCP_PROJECT/${PROJECT_ID}/g ./jetty/kubernetes/nomulus-${service}.yaml | \
|
||||
sed s/ENVIRONMENT/${env}/g > ./jetty/kubernetes/nomulus-${env}-${service}.yaml
|
||||
sed s/ENVIRONMENT/${env}/g | \
|
||||
sed s/PROXY_ENV/"${env}"/g | \
|
||||
sed s/EPP/"epp"/g > ./jetty/kubernetes/nomulus-${env}-${service}.yaml
|
||||
# Proxy '--log' flag does not work on production.
|
||||
if [ ${env} == production ]
|
||||
then
|
||||
@@ -196,6 +204,8 @@ steps:
|
||||
# canary
|
||||
sed s/GCP_PROJECT/${PROJECT_ID}/g ./jetty/kubernetes/nomulus-${service}.yaml | \
|
||||
sed s/ENVIRONMENT/${env}/g | \
|
||||
sed s/PROXY_ENV/"${env}_canary"/g | \
|
||||
sed s/EPP/"epp-canary"/g | \
|
||||
sed s/${service}/${service}-canary/g \
|
||||
> ./jetty/kubernetes/nomulus-${env}-${service}-canary.yaml
|
||||
# Proxy '--log' flag does not work on production.
|
||||
@@ -264,7 +274,7 @@ steps:
|
||||
$(gcloud auth list --format='get(account)' --filter=active)
|
||||
git add .
|
||||
git commit -m "Release commit for tag ${TAG_NAME}"
|
||||
git push -o nokeycheck origin master
|
||||
git push -o nokeycheck origin master
|
||||
git tag ${TAG_NAME}
|
||||
git push -o nokeycheck origin ${TAG_NAME}
|
||||
timeout: 3600s
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# This will do rolling restarts of all proxies. This forces the client to reconnect
|
||||
# and resets the sessions.
|
||||
#
|
||||
# To manually trigger a build on GCB, run:
|
||||
# gcloud builds submit --config=cloudbuild-restart-proxies.yaml \
|
||||
# --substitutions=_ENV=[ENV] ..
|
||||
#
|
||||
# To trigger a build automatically, follow the instructions below and add a trigger:
|
||||
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
|
||||
#
|
||||
# Note: to work around the issue in Spinnaker's 'Deployment Manifest' stage,
|
||||
# variable references must avoid the ${var} format. Valid formats include
|
||||
# $var or ${"${var}"}. This file uses the former. Since TAG_NAME and _ENV are
|
||||
# expanded in the copies sent to Spinnaker, we preserve the brackets around
|
||||
# them for safe pattern matching during release.
|
||||
# See https://github.com/spinnaker/spinnaker/issues/3028 for more information.
|
||||
steps:
|
||||
# Pull the credential for nomulus tool.
|
||||
- name: 'gcr.io/$PROJECT_ID/builder:latest'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
gcloud secrets versions access latest \
|
||||
--secret nomulus-tool-cloudbuild-credential > tool-credential.json
|
||||
# Do rolling restarts of all proxies in all environments.
|
||||
- name: 'gcr.io/$PROJECT_ID/builder:latest'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
if [ ${_ENV} == production ]
|
||||
then
|
||||
project_id="domain-registry"
|
||||
else
|
||||
project_id="domain-registry-${_ENV}"
|
||||
fi
|
||||
|
||||
gcloud auth activate-service-account --key-file=tool-credential.json
|
||||
|
||||
while read line
|
||||
do
|
||||
name=$(echo $line | awk '{print $1}')
|
||||
location=$(echo $line | awk '{print $2}')
|
||||
echo $name $region
|
||||
echo "Updating cluster $name in location $location..."
|
||||
gcloud container clusters get-credentials $name \
|
||||
--project $project_id --location $location
|
||||
kubectl rollout restart deployment/proxy-deployment
|
||||
done < <(gcloud container clusters list --project $project_id | grep proxy-cluster)
|
||||
timeout: 3600s
|
||||
options:
|
||||
machineType: 'N1_HIGHCPU_8'
|
||||
Reference in New Issue
Block a user