Add canary service to GKE (#2594)

This commit is contained in:
Lai Jiang
2024-10-22 17:12:00 +00:00
committed by GitHub
parent 4d96e5a6b1
commit a9ba770bfa
20 changed files with 368 additions and 49 deletions
+5
View File
@@ -37,6 +37,11 @@ do
sed s/GCP_PROJECT/"${project}"/g "./kubernetes/nomulus-${service}.yaml" | \
sed s/ENVIRONMENT/"${environment}"/g | \
kubectl apply -f -
# canary
sed s/GCP_PROJECT/"${project}"/g "./kubernetes/nomulus-${service}.yaml" | \
sed s/ENVIRONMENT/"${environment}"/g | \
sed s/"${service}"/"${service}-canary"/g | \
kubectl apply -f -
done
# Kills all running pods, new pods created will be pulling the new image.
kubectl delete pods --all
@@ -30,6 +30,42 @@ spec:
kind: ServiceImport
name: backend
port: 80
- matches:
- path:
type: PathPrefix
value: /_dr/task
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /_dr/cron
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /_dr/admin
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /_dr/epptool
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /loadtest
headers:
- name: "canary"
value: "true"
backendRefs:
- group: net.gke.io
kind: ServiceImport
name: backend-canary
port: 80
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
@@ -45,3 +81,18 @@ spec:
group: net.gke.io
kind: ServiceImport
name: backend
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
name: backend-canary
spec:
default:
config:
type: HTTP
httpHealthCheck:
requestPath: /healthz/
targetRef:
group: net.gke.io
kind: ServiceImport
name: backend-canary
@@ -21,6 +21,24 @@ spec:
kind: ServiceImport
name: console
port: 80
- matches:
- path:
type: PathPrefix
value: /console-api
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /console
headers:
- name: "canary"
value: "true"
backendRefs:
- group: net.gke.io
kind: ServiceImport
name: console-canary
port: 80
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
@@ -36,3 +54,18 @@ spec:
group: net.gke.io
kind: ServiceImport
name: console
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
name: console-canary
spec:
default:
config:
type: HTTP
httpHealthCheck:
requestPath: /healthz/
targetRef:
group: net.gke.io
kind: ServiceImport
name: console-canary
@@ -18,6 +18,18 @@ spec:
kind: ServiceImport
name: frontend
port: 80
- matches:
- path:
type: PathPrefix
value: /_dr/epp
headers:
- name: "canary"
value: "true"
backendRefs:
- group: net.gke.io
kind: ServiceImport
name: frontend-canary
port: 80
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
@@ -33,3 +45,18 @@ spec:
group: net.gke.io
kind: ServiceImport
name: frontend
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
name: frontend-canary
spec:
default:
config:
type: HTTP
httpHealthCheck:
requestPath: /healthz/
targetRef:
group: net.gke.io
kind: ServiceImport
name: frontend-canary
@@ -27,6 +27,36 @@ spec:
kind: ServiceImport
name: pubapi
port: 80
- matches:
- path:
type: PathPrefix
value: /_dr/whois
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /check
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /whois
headers:
- name: "canary"
value: "true"
- path:
type: PathPrefix
value: /rdap
headers:
- name: "canary"
value: "true"
backendRefs:
- group: net.gke.io
kind: ServiceImport
name: pubapi-canary
port: 80
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
@@ -42,3 +72,18 @@ spec:
group: net.gke.io
kind: ServiceImport
name: pubapi
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
name: pubapi-canary
spec:
default:
config:
type: HTTP
httpHealthCheck:
requestPath: /healthz/
targetRef:
group: net.gke.io
kind: ServiceImport
name: pubapi-canary