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 syncing
configurations from a central source of truth, such as a Git repository, an OCI
image, or a Helm chart. If the default installation instructions
don'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 of
Config Sync. The installation process includes the following:
Installing Config Sync on individual clusters using the
Google Cloud console, the Google Cloud CLI, or Terraform.
Configuring your root repository, including source type, format, and
authentication.
Verifying the successful installation and configuration of Config Sync.
Before you install Config Sync, prepare your source 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 authorize
Config Sync to read your configurations, complete the following steps:
Create, or have access to, a source of truth that contains the configuration
files that you want Config Sync to sync to your clusters. For more information, see the
following resources:
When you install Config Sync using the Google Cloud console or the
Google Cloud CLI, Config Sync automatically creates a RootSync object named
root-sync. You can use kubectl commands to modify root-sync and add
additional Config Sync configurations. For more information, see
Configure Config Sync with kubectl 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 individual
clusters automatically registers those clusters to your fleet.
In the Google Cloud console, go to the Config page under the Features section.
Select the Config Sync version that you want to use.
Under Installation options, select one of the following options:
Install Config Sync on entire fleet (recommended): Config Sync
is installed on all clusters in the fleet.
Install Config Sync on individual clusters: Config Sync is
installed 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 the
Available clusters table, select the clusters on which you want to install Config Sync.
Click Install Config Sync. In the Settings tab, after a few minutes,
you should see Enabled in the Status 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 a
source of truth. You can deploy the same package
to multiple clusters or deploy different packages to different clusters.
You can edit a package after deploying it, except for some settings like
package name and sync type. For more information, see
Manage packages.
To deploy a package, complete the following steps:
In the Google Cloud console, go to the Config Sync dashboard.
In the Select clusters for package deployment table, select the cluster
that you want to deploy a package to and then click Continue.
Select either Package hosted on Git or Package hosted on OCI as
your source type and then click Continue.
In the Package details section, enter a Package name, which
identifies the RootSync or RepoSync object.
In the Sync type field, choose either Cluster scoped sync or Namespace scoped sync as
the sync type.
Cluster scoped sync creates a RootSync object and Namespace scoped sync creates a RepoSync object.
For more information about these objects, see
Config Sync architecture.
In the Source 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 truth
as the Repository URL.
Optional: Update the Revision field to check out if you're not using
the default HEAD.
Optional: Update the Path field if you don't want to sync from the
root repository.
Optional: Update the Branch field if you're not using the default
main branch.
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 truth
as the Image.
Enter the path of the directory to sync from,
relative to the root directory, as the Directory.
(Optional): Expand the Advanced settings section to complete the following:
Select an Authentication type. Config Sync needs read-only access to
your 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 Sync
read-only access to your Git repository,
OCI image, or Helm chart (gcloud CLI only).
Choose the same authentication type that you configured when you installed
Config Sync:
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 a
Cloud Source Repositories repository. Only select this option if
Workload Identity Federation for GKE is not enabled in your cluster.
Workload Identity: Use a Google service account to access a
Cloud Source Repositories repository.
Enter a number in seconds to set the Sync wait time, which determines
how long Config Sync waits between attempts to pull from the source of truth.
Enter a Git proxy URL for the HTTPS proxy to be used when
communicating with the source of truth.
Click Deploy Package.
You are redirected to the Config Sync Packages page. After a few
minutes, you should see Synced in the Sync status
column for the cluster that you configured.
Prepare the configuration by creating a file named apply-spec.yaml and
copying the following YAML file into it.
You can set all of the optional spec.configSync fields that you need
when you create your manifest, and later use
kubectl commands for configuration.
You can also only set the spec.configSync.enabled field as true and
omit the optional fields. You can then later use kubectl commands to
create additional RootSync objects
or RepoSyncs that you can fully manage using kubectl 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:
SOURCE_TYPE: add git to sync from a Git repository,
oci to sync from an OCI image, or helm to sync from a Helm chart.
If no value is specified, the default is git.
FORMAT: add unstructured to use an
unstructured repository or add
hierarchy to use a
hierarchical repository.
These values are case-sensitive.
This field is optional and the default value is
hierarchy. We recommend that you add unstructured, because this format
lets you organize your configs in the way that is most convenient to
you.
REPO: add the URL of the source of truth.
Git and Helm repository URLs use either the HTTPS or SSH protocol. For
example, https://github.com/GoogleCloudPlatform/anthos-config-management-samples. If you plan to use SSH as your secretType,
enter your URL with the SSH protocol. This field is required and if you
don'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 the latest tag, but you can
pull in images by TAG or DIGEST instead. Specify TAG or DIGEST
in the PACKAGE_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
REVISION: the Git revision (tag or hash)
or branch name to sync from. When using a hash, it must be a full
hash, and not an abbreviated form.
EMAIL: If you added
gcpserviceaccount as your secretType, add your Google service
account email address. For example,
acm@PROJECT_ID.iam.gserviceaccount.com.
METRICS_EMAIL: the email of the Google Cloud
Service Account (GSA) used for exporting Config Sync metrics to
Cloud Monitoring. The GSA should have the Monitoring Metric Writer
(roles/monitoring.metricWriter) IAM role.
The Kubernetes ServiceAccount default in the namespace
config-management-monitoring should be
bound to the GSA.
DIRECTORY: the path of the directory to sync from,
relative to the root of the Git repository. All sub-directories of the
directory that you specify are included and synced to the cluster. The
default value is the root directory of the repository.
For a complete list of fields that you can add to the spec field,
see gcloud fields.
Apply the apply-spec.yaml file. If you are using an existing manifest,
you should apply the file to the cluster that you want to
configure with the settings that you fetched in the previous command:
MEMBERSHIP_NAME: the fleet membership name that you chose
when you registered your cluster. You can find the name with
gcloud container fleet memberships list.
CONFIG_YAML_PATH: the path to your
apply-spec.yaml file.
PROJECT_ID: your project ID.
Terraform
For each cluster that you want to configure Config Sync,
apply a google_gkehub_feature_membership resource block that contains
a configmanagement and config_sync block, such as in the following example:
After you configure your root repository, you can optionally
configure syncing from multiple repositories,
including other root repositories and namespace repositories. The namespace
repositories are helpful if you want a repository that contains namespace-scoped
configs synced to a particular namespace across clusters.
Verify the installation
After you install and configure Config Sync, you can verify
that the installation completed successfully.
In most cases, the
default resource requests and limits
for Config Sync components are sufficient. However, you can override the
requests and limits for the default CPU and memory to ensure that components
have enough resources to operate reliably. For example, if you are syncing a
large number of resources to your cluster, you might need to provide more
resources to the reconciler-manager.
You can override the resource requests and limits for some Config Sync
components by using the deploymentOverrides field in your apply-spec.yaml file
when you install Config Sync with the gcloud CLI. You can't
use the deploymentOverrides field to override other fields in a Deployment,
such as the number of replicas.
The deploymentOverrides field can only override the resource requests
and limits for deployments that are not a root or namespace reconciler, such as
the reconciler-manager. If you need to override the resources for a
root or namespace reconciler, you can use the spec.override.resources field in the
RootSync or RepoSync object.
The following example shows how to use the deploymentOverrides field to set a
new CPU request and limit and a new memory request and limit for the
reconciler-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 your apply-spec.yaml file, apply it by running the following command:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-09 UTC."],[],[]]