1
0
mirror of https://github.com/google/nomulus synced 2025-12-23 06:15:42 +00:00

Make Nomulus work on GKE with external load balancer (#2527)

This will create a multi-cluster external load balancer exposing HTTP
traffic to nomulus running in clusters in the fleet.
This commit is contained in:
Lai Jiang
2024-08-14 10:32:39 -04:00
committed by GitHub
parent ec3804e87e
commit 2fd9b062df
4 changed files with 33 additions and 9 deletions

View File

@@ -31,12 +31,16 @@ do
echo "Updating cluster ${parts[0]} in location ${parts[1]}..." echo "Updating cluster ${parts[0]} in location ${parts[1]}..."
gcloud container clusters get-credentials "${parts[0]}" \ gcloud container clusters get-credentials "${parts[0]}" \
--project "${project}" --location "${parts[1]}" --project "${project}" --location "${parts[1]}"
sed s/GCP_PROJECT/${project}/g "./kubernetes/nomulus-deployment.yaml" | \ sed s/GCP_PROJECT/"${project}"/g "./kubernetes/nomulus-deployment.yaml" | \
sed s/ENVIRONMENT/${environment}/g | \ sed s/ENVIRONMENT/"${environment}"/g | \
kubectl apply -f - kubectl apply -f -
kubectl apply -f "./kubernetes/nomulus-service.yaml" kubectl apply -f "./kubernetes/nomulus-service.yaml"
#kubectl apply -f "./kubernetes/nomulus-gateway.yaml"
# Kills all running pods, new pods created will be pulling the new image. # Kills all running pods, new pods created will be pulling the new image.
kubectl delete pods --all kubectl delete pods --all
done < <(gcloud container clusters list --project ${project} | grep nomulus) # The multi-cluster gateway is only deployed to one cluster (the one in the US).
if [[ "${parts[1]}" == us-* ]]
then
kubectl apply -f "./kubernetes/nomulus-gateway.yaml"
fi
done < <(gcloud container clusters list --project "${project}" | grep nomulus)
kubectl config use-context "$current_context" kubectl config use-context "$current_context"

View File

@@ -28,4 +28,19 @@ spec:
kind: ServiceImport kind: ServiceImport
name: nomulus name: nomulus
port: 80 port: 80
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
name: nomulus
spec:
default:
config:
type: HTTP
httpHealthCheck:
requestPath: /healthz/
targetRef:
group: net.gke.io
kind: ServiceImport
name: nomulus

View File

@@ -15,8 +15,8 @@ spec:
- port: 700 - port: 700
targetPort: epp targetPort: epp
name: epp name: epp
#--- ---
#kind: ServiceExport kind: ServiceExport
#apiVersion: net.gke.io/v1 apiVersion: net.gke.io/v1
#metadata: metadata:
# name: nomulus name: nomulus

View File

@@ -0,0 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<title>Health Check</title>
<body>Health check successful.</body>
</html>