Migrate your RootSync to manage in the Google Cloud console
This page shows you how to migrate your Hub-managed RootSync to a RootSync object. The migration enables you to manage your RootSync in the Google Cloud console.
Do not use these instructions if you are managing the RootSync with tools like
Terraform or custom tools built on gcloud. To edit your RootSync, use gcloud
beta container fleet config-management apply
instead.
To check if your RootSync is Hub-managed, run kubectl -n config-management-system get RootSyncs root-sync -o jsonpath='{.metadata.annotations}'
.
If you see the annotation "configmanagement.gke.io/managed-by-hub": "true"
, the RootSync is Hub-managed.
To migrate your RootSync, complete the following steps:
Create a gcloud apply spec with all fields in
spec.configSync
removed exceptspec.configSync.enabled
. Set the value ofspec.configSync.enabled
totrue
.The apply spec should look similar to the following example:
# apply-spec.yaml applySpecVersion: 1 spec: configSync: enabled: true
Apply the configuration:
gcloud beta container fleet config-management apply --config=apply-spec.yaml
To confirm the RootSync is successfully migrated, in the Google Cloud console, go to the Config Sync packages dashboard. You should be able to edit the RootSync when you expand the package name.