Customize your Config Sync installation

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:

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.

  1. In the Google Cloud console, go to theConfig page under theFeatures section.

    Go to Config

  2. ClickInstall Config Sync.
  3. Select the Config Sync version that you want to use.
  4. 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.
  5. If you're installing Config Sync on individual clusters, in theAvailable clusters table, select the clusters on which you want to install Config Sync.
  6. 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:

  1. In the Google Cloud console, go to theConfig Sync dashboard.

    Go to Config Sync dashboard

  2. ClickDeploy Package.

  3. In theSelect clusters for package deployment table, select the clusterthat you want to deploy a package to and then clickContinue.

  4. Select eitherPackage hosted on Git orPackage hosted on OCI asyour source type and then clickContinue.

  5. In thePackage details section, enter aPackage name, whichidentifies the RootSync or RepoSync object.

  6. 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.

  7. In theSource section, complete the following:

    • For sources hosted in a Git repository, enter the following fields:

      1. Enter the URL of the Git repository that you're using as a source of truthas theRepository URL.
      2. Optional: Update theRevision field to check out if you're not usingthe defaultHEAD.
      3. Optional: Update thePath field if you don't want to sync from theroot repository.
      4. Optional: Update theBranch field if you're not using the defaultmain branch.
    • For sources hosted in an OCI image, enter the following fields:

      1. Enter the URL of the OCI image that you're using as a source of truthas theImage.
      2. Enter the path of the directory to sync from,relative to the root directory, as theDirectory.
  8. (Optional): Expand theAdvanced settings section to complete the following:

    1. 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 acookiefile.
      • 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.
    2. 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.

    3. Enter aGit proxy URL for the HTTPS proxy to be used whencommunicating with the source of truth.

  9. 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.

  1. Enable theConfigManagement fleet feature:

    gcloudbetacontainerfleetconfig-managementenable
  2. Prepare the configuration by creating a file namedapply-spec.yaml andcopying the following YAML file into it.

    You can set all of the optionalspec.configSync fields that you needwhen you create your manifest, and later usekubectl commands for configuration.You can also only set thespec.configSync.enabled field astrue andomit the optional fields. You can then later usekubectl commands tocreate additional RootSync objectsor RepoSyncs that you can fully manage usingkubectl commands 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:false

    Replace the following:

    For a complete list of fields that you can add to thespec field,seegcloud fields.

    Note: If you don't have a source of truth prepared yet, you can enableConfig Sync without configuring any settings by settingspec.configSync.enabled totrue and omitting all otherspec.configSync fields. When you have prepared your repository, edityourapply-spec.yaml to add the configuration settings.
  3. Apply theapply-spec.yaml file. 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_ID

    Replace 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.yaml file.
    • 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:

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:

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:

nomosstatus

A 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:

  1. In the Google Cloud console, go to theConfig page under theFeatures section.

    Go to Config

  2. 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:512Mi

After 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_ID

For a complete list of the fields that you can override, see thegcloud apply spec fields reference documentation.

What's next

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.