Professional Cloud DevOps Engineer
Fleet Registration is the process of grouping multiple GKE clusters from different Google Cloud projects under a single management umbrella, called a fleet. This allows you to manage clusters in staging, production, and development from one central place, applying consistent security policies, logging, and identity rules across all of them.
Several types of service accounts are key to making fleets work securely. The Compute Engine default service account handles basic system tasks on cluster nodes. The Google APIs Service Agent and the Kubernetes Engine Service Agent have special permissions to manage Google Cloud resources on behalf of your clusters. You can check these permissions using the gcloud projects get-iam-policy command. Fleet Workload Identity builds on this by providing a unified way for workloads in any cluster to securely access Google Cloud services without managing separate passwords or keys.
Managing permissions correctly is critical, especially across multiple projects. In newer organizations, a policy might prevent the default service account from automatically getting the permissions GKE needs. In these cases, an administrator must manually grant the necessary roles. When setting up fleets, you should follow the principle of least privilege, giving each service account only the specific, predefined roles it needs rather than broad, powerful roles. This ensures secure and controlled operations across your entire fleet of clusters.
To connect applications across different clusters in a fleet, you use Multi-Cluster Services (MCS). MCS extends a standard Kubernetes Service so it can be discovered and used by Pods in other clusters. For this to work, the clusters must be registered to the same fleet, use compatible VPC networking, and have the proper permissions. When you export a service using a ServiceExport resource, MCS automatically sets up the needed Cloud DNS zones and firewall rules. Pods in other clusters can then find that service using a special domain name ending in svc.clusterset.local.
For handling internet traffic, Multi-Cluster Ingress (MCI) provides global load balancing. MCI gives you a single anycast VIP address that can route user traffic to your application running in clusters across different regions. It uses a central config cluster to define the ingress rules. Behind the scenes, MCI creates Network Endpoint Groups (NEGs) that dynamically track the healthy Pods in each cluster. If Pods in one region or cluster fail, the global load balancer automatically reroutes traffic to the healthy Pods in another location, providing failover.
You can fine-tune this traffic management using custom resources. A BackendConfig lets you control settings like health checks and how connections are closed for backend services. A FrontendConfig manages settings for the load balancer itself, such as SSL policies. Using these tools together allows enterprise platform teams to ensure consistent, reliable, and secure traffic routing for applications deployed across a global fleet of GKE clusters.
Managing many clusters requires a way to keep their configurations identical and secure. Fleet-wide configuration management uses a central system to apply settings—like network policies or resource limits—to every cluster in the fleet. This prevents configuration drift, where clusters become different over time and cause operational problems. A popular method for this is GitOps, which treats a Git repository as the single source of truth for all cluster configurations.
Config Sync is the tool that puts GitOps into action for GKE fleets. It continuously watches your Git repository. When you commit a change, like updating a deployment file, Config Sync automatically pulls that change and applies it to all the designated clusters. This ensures consistency, provides a full audit trail of changes in Git, and allows for easy rollbacks by simply reverting a bad commit.
While Config Sync applies the desired state, Policy Controller acts as a security guard. It uses the Open Policy Agent (OPA) framework to enforce rules you define, such as “all containers must use images from our approved registry” or “Pods cannot run with root privileges.” Policy Controller constantly monitors the fleet and will block any resource that violates these policies, even if Config Sync tries to deploy it. This creates a secure, self-healing system where platform teams can define governance in code once and have it enforced automatically across all staging and production environments.
Prepare and test your skills
Prepare and test your skills
Multi-Cluster Services (MCS) extends standard Kubernetes Services by allowing exported services to be discovered across clusters registered to the same fleet. When a service is exported using a ServiceExport resource, MCS automatically configures the necessary Cloud DNS zones and firewall rules so Pods in other clusters can reach it using the svc.clusterset.local domain.
Multi-Cluster Ingress (MCI) provides global load balancing through a single anycast VIP address and defines ingress rules from a centralized config cluster. It uses Network Endpoint Groups (NEGs) to dynamically monitor healthy Pods across clusters and automatically reroutes user traffic to healthy Pods in other locations if a regional failure occurs.
Config Sync uses a GitOps model to automatically deploy configuration updates from a central Git repository to clusters to prevent configuration drift. Policy Controller uses the Open Policy Agent (OPA) framework to enforce security rules and actively blocks any resource that violates those policies, even if Config Sync attempts to deploy it.
Configure a central unstructured Git repository managed by the platform team that deploys cluster-scoped RootSync objects for Policy Controller constraints, alongside namespace-scoped RepoSync objects pointing to dedicated application configuration repositories in WET folder structures; authenticate reconcilers using Workload Identity Federation for GKE.
Configure cluster-scoped RootSync objects to deploy Kubernetes Job resources that execute kubectl apply commands for Policy Controller constraints, use dynamic ClusterSelectors with DRY template rendering in a single monorepo for all environments, and store access tokens in cluster secrets.
Configure a single hierarchical Git repository containing abstract namespaces and CRDs in the cluster/ directory, manage both application and security configs within the same repository using long-lived Git branches (staging and prod), and authenticate the ConfigManagement Operator using Compute Engine default service accounts.
Configure a central Git repository containing application source code and deployment manifests together, define all namespace configurations using cluster-scoped RootSync objects directly, and use the client.lifecycle.config.k8s.io/mutation: ignore annotation on all Policy Controller constraints so application teams can override them locally.
Your enterprise manages multiple Google Kubernetes Engine (GKE) clusters grouped into staging and production fleets. Your platform engineering team needs to implement a fleet-wide GitOps architecture using Config Sync and Policy Controller that satisfies the following requirements:
Which configuration architecture should you implement?