Home Explore Blog CI



kubernetes

2nd chunk of `content/en/blog/_posts/2016-10-00-Globally-Distributed-Services-Kubernetes-Cluster-Federation.md`
ea0c5735a69e71a27d2b04049ee091c5cbb855fe8a861b4c0000000100000935
![](https://2.bp.blogspot.com/-Gj83DdcKqTI/WAE8pwAEZYI/AAAAAAAAAwI/9dbyBFipvDIGkPQWRB1dRxNwkrvzlcYMwCLcB/s400/k8s%2Bfed%2Bmap.png)](https://2.bp.blogspot.com/-Gj83DdcKqTI/WAE8pwAEZYI/AAAAAAAAAwI/9dbyBFipvDIGkPQWRB1dRxNwkrvzlcYMwCLcB/s1600/k8s%2Bfed%2Bmap.png)



The next step is to federate these clusters. Kelsey Hightower developed a [tutorial](https://github.com/kelseyhightower/kubernetes-cluster-federation) for setting up a Kubernetes Cluster Federation. Follow the tutorial to configure a Cluster Federation with clusters in 3 zones in each of the 3 GCP regions, us-central1, europe-west1 and asia-east1. For the purpose of this blog post, we’ll provision the Federation Control Plane in the us-central1-b zone. Note that more highly available, multi-cluster deployments are also available, but not used here in the interests of simplicity.



The rest of the blog post assumes that you have a running Kubernetes Cluster Federation provisioned.



Let’s verify that we have 9 clusters in 3 regions running.



 ```
$ kubectl --context=federation-cluster get clusters


NAME              STATUS    AGE  
gce-asia-east1-a     Ready     17m  
gce-asia-east1-b     Ready     15m  
gce-asia-east1-c     Ready     10m  
gce-europe-west1-b   Ready     7m  
gce-europe-west1-c   Ready     7m  
gce-europe-west1-d   Ready     4m  
gce-us-central1-a    Ready     1m  
gce-us-central1-b    Ready     53s  
gce-us-central1-c    Ready     39s
  ```



|You can download the source used in this blog post [here](https://github.com/allannaim/federated-ingress-sample). The source consists of the following files:|
|---|---|
|configmaps/zonefetch.yaml| retrieves the zone from the instance metadata server and concatenates into volume mount path|
|replicasets/nginx-rs.yaml | deploys a Pod consisting of an nginx and busybox container|
|ingress/ingress.yaml | creates a load balancer with a global VIP  that distributes requests to the closest nginx backend|
|services/nginx.yaml| exposes the nginx backend as an external service|




In our example, we’ll be deploying the service and ingress object using the federated control plane. The [ConfigMap](/docs/user-guide/configmap/) object isn’t currently supported by Federation, so we’ll be deploying it manually in each of the underlying Federation clusters. Our cluster deployment will look as follows:

Title: Setting up and Verifying the Kubernetes Cluster Federation
Summary
This section describes the process of setting up a Kubernetes Cluster Federation across multiple Google Cloud Platform (GCP) regions using a tutorial by Kelsey Hightower. It outlines configuring the federation with clusters in three zones across us-central1, europe-west1, and asia-east1, with the Federation Control Plane provisioned in the us-central1-b zone. It then provides a command to verify the running clusters and lists the source files used in the blog post, which include configurations for ConfigMaps, ReplicaSets, Ingress, and Services. The ConfigMap is deployed manually, while the service and ingress objects are deployed via the federated control plane.