Multi Cluster Ingress — GKE
Background
In the last snippet, I explored the Multi Cluster Service in GKE using traffic director which enables a single cluster set FQDN to load-balanced between services in different clusters. In this snippet, I focus on the Multi Cluster Ingress which allows me to set an ingress that loadbalanced between two backends in a different cluster. To set the context I have not yet used Anthos Service Mesh at this point.
To see the documentation please go to :
and
Test
In this test the oversimplified version is that:
- I will create two different clusters with the same configuration I used for Multi Cluster Service, one in asia-southeast1-b and the other is in asia-southeast2-b.
- Register the cluster into Hub
- Enable the MCI on the cluster
- Deploy the MCS svc & MCI CRD on the Cluster
The Multi Cluster Ingress will allow me to create an HTTP(S) Load Balancer that has two backends coming from both clusters which came from a headless service created. This headless service has the pods ip as the endpoint which allows the ingress to have visibility to the pods.
Steps
[One] Let’s create the two clusters, I will emphasize enabling the workload identity option.
For easier moving between contexts, we can rename the context or directly use kubectx cli. One highlight is to prepare namespaces that I may use on both clusters.
[Two] Then we can register the cluster into the hub and then enable hub ingress config on one of the clusters.
We can check by describing the hub ingress configuration through gcloud command
gcloud beta container hub ingress describe
[Three] let's deploy the workloads into both clusters but wait for exposing the service at a later step using the multi-cluster-service & multi-cluster-ingress on the cluster we configure the hub ingress.
[Four] Let's test to call the ingress VIP
When I run curl from my cloud shell it will redirect to the nearest cluster which in the end redirected to pods in asia-southeast1 (SG Cluster), I run the kubectl get pods -n sharedsvc in Jkt cluster to show that the list of pods is over there.
That’s the test for this snippet which shows the test for Multi Cluster Ingress that directly load balanced the traffic to the sets of backend through single HTTP(S) Load Balancer. Do you have any experience in running such a configuration? Looking forward to some stories!
Join FAUN: Website 💻|Podcast 🎙️|Twitter 🐦|Facebook 👥|Instagram 📷|Facebook Group 🗣️|Linkedin Group 💬| Slack 📱|Cloud Native News 📰|More.
If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇