Disabling Hierarchy Controller on your clusters lets you upgrade
Config Sync to newer supported versions. Because Hierarchy Controller
is no longer available, Config Sync blocks upgrades if the component
remains installed on a cluster.

## Before you begin

To determine how to disable Hierarchy Controller, inspect the
[`kubectl` `ConfigManagement` object](https://docs.cloud.google.com/kubernetes-engine/config-sync/docs/configmanagement-fields.md.txt)
or [`gcloud` `apply spec` file](https://docs.cloud.google.com/kubernetes-engine/config-sync/docs/reference/gcloud-apply-fields.md.txt)
and take an action that corresponds to the value in the following fields:

- `hierarchyController.enablePodTreeLabels`: if `true`, and you previously enabled hierarchical observability, don't proceed with the steps in this document. Instead, contact [Cloud Customer Care](https://docs.cloud.google.com/support/docs.md.txt) for help removing Hierarchy Controller.
- `hierarchyController.enabled`: if `true`, follow the instructions in [Disable Hierarchy Controller](https://docs.cloud.google.com/kubernetes-engine/config-sync/docs/how-to/migrate-hierarchy-controller.md.txt#disable-hierarchy-controller).

## Disable Hierarchy Controller

When you disable Hierarchy Controller, Config Sync deletes the
Hierarchy Controller components in your cluster but doesn't delete the
Hierarchy Controller CustomResourceDefinitions. You must manually remove
those CustomResourceDefinitions by using the `kubectl` command-line tool:

- `HierarchyConfiguration`
- `HNCConfiguration`
- `SubnamespaceAnchor`
- `HierarchicalResourceQuota`

To remove the Hierarchy Controller fields, review the instructions
for the method that you used to install Hierarchy Controller:

### gcloud

Remove the `hierarchyController` block from your
[Google Cloud CLI `apply spec` file](https://docs.cloud.google.com/kubernetes-engine/config-sync/docs/reference/gcloud-apply-fields.md.txt).

### Terraform

Remove the `hierarchyController` block from your
[Terraform resource](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/gke_hub_feature_membership#argument-reference).

### Config Connector

Set Hierarchy Controller fields to `false` in the
[`GKEHubFeatureMembership`](https://docs.cloud.google.com/config-connector/docs/reference/resource-docs/gkehub/gkehubfeaturemembership.md.txt)
resource.

> [!IMPORTANT]
> **Important:** Don't remove the Hierarchy Controller fields from the `GKEHubFeatureMembership` resource. Removing the fields doesn't disable Hierarchy Controller and causes the fields to become [externally-managed](https://docs.cloud.google.com/config-connector/docs/concepts/managing-fields-externally.md.txt) instead of managed by Config Connector.

### kubectl

Remove the `hierarchyController` block from the
[`ConfigManagement` object](https://docs.cloud.google.com/kubernetes-engine/config-sync/docs/configmanagement-fields.md.txt).