Customize your Config Sync installation Stay organized with collections Save and categorize content based on your preferences.
With Config Sync, you can manage your Kubernetes resources by syncingconfigurations from a central source of truth, such as a Git repository, an OCIimage, or a Helm chart. If thedefault installation instructionsdon't suit your needs, you might need to customize your Config Sync installation.
This page shows you how to perform an advanced installation and configuration ofConfig Sync. The installation process includes the following:
- Installing Config Sync on individual clusters using theGoogle Cloud console, the Google Cloud CLI, or Terraform.
- Configuring your root repository, including source type, format, andauthentication.
- Verifying the successful installation and configuration of Config Sync.
Limitations
Config Sync doesn't support configuringhelm as the source typeusing the Google Cloud console or the Google Cloud CLI. You can configure yourRootSync orRepoSync object to sync from a Helm repository using theKubernetes API, ordeclare it in another source of truth.SeeConfiguration for the Helm repositoryfor more information.
Before you begin
Before you install Config Sync, prepare yoursource of truth and a suitable cluster.
Grant Config Sync access to your source of truth
To synchronize configuration from a source of truth to your clusters,Config Sync requires read-only access to your repository. To authorizeConfig Sync to read your configurations, complete the following steps:
Create, or have access to, a source of truth that contains the configurationfiles that you want Config Sync to sync to your clusters. For more information, see thefollowing resources:
- Add configs to a source of truth: conceptual information about configurations.
- GitOps best practices: tips and general best practices for organizing and managing your repository.
- Use an unstructured repo: recommendations for using and organizing an unstructured repository.
If your source of truth is public, no further action is needed.Config Sync doesn't require extra permissions.
If your source of truth is private, complete the instructions in one of the following pages:
Review cluster requirements
Before you create a cluster, reviewcluster requirements.
Install Config Sync
When you install Config Sync using the Google Cloud console or theGoogle Cloud CLI, Config Sync automatically creates a RootSync object namedroot-sync. You can usekubectl commands to modifyroot-sync and addadditional Config Sync configurations. For more information, seeConfigure Config Sync withkubectl commands.
Console
Install Config Sync
To install Config Sync, all clusters must be registered to a fleet.When you install Config Sync in the Google Cloud console, selecting individualclusters automatically registers those clusters to your fleet.
- In the Google Cloud console, go to theConfig page under theFeatures section.
- ClickaddInstall Config Sync.
- Select the Config Sync version that you want to use.
- UnderInstallation options, select one of the following options:
- Install Config Sync on entire fleet (recommended): Config Syncis installed on all clusters in the fleet.
- Install Config Sync on individual clusters: Config Sync isinstalled on the clusters that you select. Any selected clusters are automatically registered to your fleet.
- If you're installing Config Sync on individual clusters, in theAvailable clusters table, select the clusters on which you want to install Config Sync.
- ClickInstall Config Sync. In theSettings tab, after a few minutes,you should seeEnabled in theStatus column for the clusters in your fleet.
Deploy a package
After you have registered your clusters to a fleet and installed Config Sync,you can configure Config Sync to deploy a package to a cluster from asource of truth. You can deploy the same packageto multiple clusters or deploy different packages to different clusters.You can edit a package after deploying it, except for some settings likepackage name and sync type. For more information, seeManage packages.
Note: If you want Config Sync to render and apply a Helm chart, you mustconfigure Config Sync with the Google Cloud CLI instead.To deploy a package, complete the following steps:
In the Google Cloud console, go to theConfig Sync dashboard.
ClickDeploy Package.
In theSelect clusters for package deployment table, select the clusterthat you want to deploy a package to and then clickContinue.
Select eitherPackage hosted on Git orPackage hosted on OCI asyour source type and then clickContinue.
In thePackage details section, enter aPackage name, whichidentifies the RootSync or RepoSync object.
In theSync type field, choose eitherCluster scoped sync orNamespace scoped sync asthe sync type.
Cluster scoped sync creates a RootSync object and Namespace scoped sync creates a RepoSync object.For more information about these objects, seeConfig Sync architecture.
In theSource section, complete the following:
For sources hosted in a Git repository, enter the following fields:
- Enter the URL of the Git repository that you're using as a source of truthas theRepository URL.
- Optional: Update theRevision field to check out if you're not usingthe default
HEAD. - Optional: Update thePath field if you don't want to sync from theroot repository.
- Optional: Update theBranch field if you're not using the default
mainbranch.
For sources hosted in an OCI image, enter the following fields:
- Enter the URL of the OCI image that you're using as a source of truthas theImage.
- Enter the path of the directory to sync from,relative to the root directory, as theDirectory.
(Optional): Expand theAdvanced settings section to complete the following:
Select anAuthentication type. Config Sync needs read-only access toyour source of truth to read the configuration files in the source and apply them to your clusters.Unless your source requires no authentication, such as a public repository,ensure that you grant Config Syncread-only access to yourGit repository,OCI image, orHelm chart (gcloud CLI only).Choose the same authentication type that you configured when you installedConfig Sync:
Note: for OCI, you can only selectWorkload Identity for authentication.- None: Use no authentication.
- SSH: Authenticate by using an SSH key pair.
- Cookiefile: Authenticate by using a
cookiefile. - Token: Authenticate by using an access token or password.
- Google Cloud Repository: Use a Google service account to access aCloud Source Repositories repository. Only select this option ifWorkload Identity Federation for GKE isnot enabled in your cluster.
- Workload Identity: Use a Google service account to access aCloud Source Repositories repository.
Enter a number in seconds to set theSync wait time, which determineshow long Config Sync waits between attempts to pull from the source of truth.
Enter aGit proxy URL for the HTTPS proxy to be used whencommunicating with the source of truth.
ClickDeploy Package.
You are redirected to the Config SyncPackages page. After a fewminutes, you should seeSynced in theSync statuscolumn for the cluster that you configured.
gcloud
Before you continue, make sure you'veregistered your clustersto afleet.
Enable the
ConfigManagementfleet feature:gcloudbetacontainerfleetconfig-managementenablePrepare the configuration by creating a file named
apply-spec.yamlandcopying the following YAML file into it.You can set all of the optional
spec.configSyncfields that you needwhen you create your manifest, and later usekubectlcommands for configuration.You can also only set thespec.configSync.enabledfield astrueandomit the optional fields. You can then later usekubectlcommands tocreate additional RootSync objectsor RepoSyncs that you can fully manage usingkubectlcommands later.# apply-spec.yamlapplySpecVersion:1spec:configSync:enabled:true# If you don't have a source of truth yet, omit the# following fields. You can configure them later.sourceType:SOURCE_TYPEsourceFormat:FORMATsyncRepo:REPOsyncRev:REVISIONsecretType:SECRET_TYPEgcpServiceAccountEmail:EMAILmetricsGcpServiceAccountEmail:METRICS_EMAILpolicyDir:DIRECTORYpreventDrift:falseReplace the following:
SOURCE_TYPE: addgitto sync from a Git repository,ocito sync from an OCI image, orhelmto sync from a Helm chart.If no value is specified, the default isgit.FORMAT: addunstructuredto use anunstructured repository or addhierarchyto use ahierarchical repository.These values are case-sensitive.This field is optional and the default value ishierarchy. We recommend that you addunstructured, because this formatlets you organize your configs in the way that is most convenient toyou.REPO: add the URL of the source of truth.Git and Helm repository URLs use either the HTTPS or SSH protocol. Forexample,https://github.com/GoogleCloudPlatform/anthos-config-management-samples. If you plan to use SSH as yoursecretType,enter your URL with the SSH protocol. This field is required and if youdon't enter a protocol, the URL is treated as an HTTPS URL.OCI URLs use the following format:
LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME.By default, the image is pulled from thelatesttag, but you canpull in images byTAGorDIGESTinstead. SpecifyTAGorDIGESTin thePACKAGE_NAME:- To pull by
TAG:LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME:TAG - To pull by
DIGEST:LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME@sha256:DIGEST
tarortar+gzipformat.Other formats (for example,tar+bz2) won't be recognized byConfig Sync. Switching from a valid REPO to an OCI image with anunsupported format will cause managed resources to be pruned withoutan error.- To pull by
REVISION: the Git revision (tag or hash)or branch name to sync from. When using a hash, it must be a fullhash, and not an abbreviated form.SECRET_TYPE: one of the followingsecretTypes:git
none: Use no authentication.ssh: Use an SSH key pair.cookiefile: Use acookiefile.token: Use a token.gcpserviceaccount: Use a Google service account to access aCloud Source Repositories or Secure Source Manager repository. If you select thisauthentication type, you need to create an IAM policy binding afteryou finish configuring Config Sync. For details, see the Googleservice account tab of theGrant Config Sync access to Git with a Google service accountsection.gcenode: Use a Google service account to access aCloud Source Repositories. Only select this option if Workload Identity Federation for GKEis not enabled in your cluster.githubapp: Use a GitHub App to authenticate to a GitHub repository.
For more information on these authentication types, seeGrant Config Sync access to Git.
oci
none: Use no authenticationgcenode: Use the Compute Engine default service account toaccess an image in Artifact Registry. Only selectthis option if Workload Identity Federation for GKE is not enabled in your cluster.gcpserviceaccount: Use a Google service account to access animage.
helm
token: Use a token.gcenode: Use the Compute Engine default service account toaccess an image in Artifact Registry. Only selectthis option if Workload Identity Federation for GKE is not enabled in your cluster.gcpserviceaccount: Use a Google service account to access animage.
EMAIL: If you addedgcpserviceaccountas yoursecretType, add your Google serviceaccount email address. For example,acm@PROJECT_ID.iam.gserviceaccount.com.METRICS_EMAIL: the email of the Google CloudService Account (GSA) used for exporting Config Sync metrics toCloud Monitoring. The GSA should have the Monitoring Metric Writer(roles/monitoring.metricWriter) IAM role.The Kubernetes ServiceAccountdefaultin the namespaceconfig-management-monitoringshould bebound to the GSA.DIRECTORY: the path of the directory to sync from,relative to the root of the Git repository. All sub-directories of thedirectory that you specify are included and synced to the cluster. Thedefault value is the root directory of the repository.
For a complete list of fields that you can add to the
Note: If you don't have a source of truth prepared yet, you can enableConfig Sync without configuring any settings by settingspecfield,seegcloud fields.spec.configSync.enabledtotrueand omitting all otherspec.configSyncfields. When you have prepared your repository, edityourapply-spec.yamlto add the configuration settings.Apply the
apply-spec.yamlfile. If you are using an existing manifest,you should apply the file to the cluster that you want toconfigure with the settings that you fetched in the previous command:gcloudbetacontainerfleetconfig-managementapply\--membership=MEMBERSHIP_NAME\--config=CONFIG_YAML_PATH\--project=PROJECT_IDReplace the following:
MEMBERSHIP_NAME: the fleet membership name that you chosewhen you registered your cluster. You can find the name withgcloud container fleet memberships list.CONFIG_YAML_PATH: the path to yourapply-spec.yamlfile.PROJECT_ID: your project ID.
Terraform
For each cluster that you want to configure Config Sync,apply agoogle_gkehub_feature_membership resource block that containsaconfigmanagement andconfig_sync block, such as in the following example:
git
data "google_project" "default" {}resource "google_container_cluster" "default" { name = "gke-autopilot-basic" location = "us-central1" fleet { project = data.google_project.default.project_id } enable_autopilot = true}resource "google_gke_hub_feature" "configmanagement_feature" { name = "configmanagement" location = "global"}resource "google_gke_hub_feature_membership" "configmanagement_feature_member" { location = "global" feature = google_gke_hub_feature.configmanagement_feature.name membership = google_container_cluster.default.fleet[0].membership_id membership_location = google_container_cluster.default.fleet[0].membership_location configmanagement { config_sync { # The field `enabled` was introduced in Terraform version 5.41.0, and # needs to be set to `true` explicitly to install Config Sync. enabled = true git { sync_repo = "REPO" sync_branch = "BRANCH" policy_dir = "DIRECTORY" secret_type = "SECRET" } } }}Replace the following:
REPO: the URL to the Git repository that contains your configuration files.BRANCH: the repository branch, for examplemain.DIRECTORY: the path within the Git repository that represents the top level of the repository you want to sync.SECRET: the secret auth type.
oci
data "google_project" "default" {}resource "google_container_cluster" "default" { name = "gke-autopilot-basic" location = "us-central1" fleet { project = data.google_project.default.project_id } enable_autopilot = true}resource "google_gke_hub_feature" "configmanagement_feature" { name = "configmanagement" location = "global"}resource "google_gke_hub_feature_membership" "configmanagement_feature_member" { location = "global" feature = google_gke_hub_feature.configmanagement_feature.name membership = google_container_cluster.default.fleet[0].membership_id membership_location = google_container_cluster.default.fleet[0].membership_location configmanagement { config_sync { # The field `enabled` was introduced in Terraform version 5.41.0, and # needs to be set to `true` explicitly to install Config Sync. enabled = true oci { sync_repo = "REPO" policy_dir = "DIRECTORY" secret_type = "SECRET" } } }}Replace the following:
REPO: the URL to the OCI image repository that contains your configuration files.DIRECTORY: the absolute path of the directory containing the resources you want to sync. To use the root directory, leave this field blank.SECRET: the secret auth type.
Repeat this process for each cluster that you want to sync.
For more information about using Terraform, seeTerraform support forConfig Sync.
After you configure your root repository, you can optionallyconfigure syncing from multiple repositories,including other root repositories and namespace repositories. The namespacerepositories are helpful if you want a repository that contains namespace-scopedconfigs synced to a particular namespace across clusters.
Verify the installation
After you install and configure Config Sync, you can verifythat the installation completed successfully.
gcloud
Run the following command:
nomosstatusA successful installation shows a status ofSYNCED orPENDING.
For more details about the information supplied bynomos status, includingreported errors, seeCheck Config Sync statusin thenomos command-line tool documentation.
console
Complete the following steps:
- In the Google Cloud console, go to theConfig page under theFeatures section.
- On thePackages tab, check theSync status column in the cluster table.A successful installation of Config Sync has a status ofInstalled.A successfully configured source of truth has a status ofSynced.
Override resource requests and limits
In most cases, thedefault resource requests and limitsfor Config Sync components are sufficient. However, you can override therequests and limits for the default CPU and memory to ensure that componentshave enough resources to operate reliably. For example, if you are syncing alarge number of resources to your cluster, you might need to provide moreresources to thereconciler-manager.
You can override the resource requests and limits for some Config Synccomponents by using thedeploymentOverrides field in yourapply-spec.yaml filewhen you install Config Sync with the gcloud CLI. You can'tuse thedeploymentOverrides field to override other fields in a Deployment,such as the number of replicas.
ThedeploymentOverrides field can only override the resource requestsand limits for deployments that arenot a root or namespace reconciler, such asthereconciler-manager. If you need to override the resources for aroot or namespace reconciler, you can use thespec.override.resources field in theRootSync or RepoSync object.
The following example shows how to use thedeploymentOverrides field to set anew CPU request and limit and a new memory request and limit for thereconciler-manager container:
applySpecVersion:1spec:configSync:enabled:true# ... other fields...deploymentOverrides:-name:reconciler-managernamespace:config-management-systemcontainers:-name:reconciler-managercpuRequest:50mcpuLimit:100mmemoryRequest:256MimemoryLimit:512MiAfter you have create yourapply-spec.yaml file, apply it by running the following command:
gcloudbetacontainerfleetconfig-managementapply\--membership=MEMBERSHIP_NAME\--config=apply-spec.yaml\--project=PROJECT_IDFor a complete list of the fields that you can override, see thegcloud apply spec fields reference documentation.
What's next
- Learn how toupgrade Config Sync.
- Learn more about the
gcloudcommandsfor configuring Config Sync. - Discover how toconfigure syncing from multiple repositories.
- Use the
nomoscommand. - Read theIntroduction to troubleshooting Config Sync.
- Learn how touninstall Config Sync.
- Review theDefault Config Sync permissions.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.