Migrate from Hierarchy Controller to Hierarchical Namespace Controller (HNC)

This page explains how to migrate from Hierarchy Controller (not available starting in December, 2024) to open source Kubernetes Hierarchical Namespace Controller (HNC).

To determine how to migrate to HNC, inspect the kubectl ConfigManagement object or gcloud apply spec file and take an action that corresponds to the value in the following fields:

Disable Hierarchy Controller

When you disable Hierarchy Controller, it deletes the Hierarchy Controller components in your cluster. It does not delete the Hierarchy Controller Custom Resource Definitions (CRD):

  • HierarchyConfiguration
  • HNCConfiguration
  • SubnamespaceAnchor
  • HierarchicalResourceQuota

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

gcloud

Remove the hierarchyController block from your Google Cloud CLI apply spec file.

Terraform

Remove the hierarchyController block from your Terraform resource.

Config Connector

Set Hierarchy Controller fields to false in the GKEHubFeatureMembership resource.

kubectl

Remove the hierarchyController block from the ConfigManagement object.

Install HNC

Follow the instructions to install HNC on a cluster.

If you're using Hierarchical Resource Quotas, you must install HNC version 1.1.0 or later.

Migrate hierarchical resource quotas

If you used hierarchical resource quotas with Hierarchy Controller by setting hierarchyController.enableHierarchicalResourceQuota to true, to finish migrating to HNC, complete the following steps:

  1. Install the HNC hierarchical resource quotas by installing the hrq.yaml file under Releases > Assets.

  2. To migrate the existing hierarchical resource quota custom resources, change the apiVersion field from hierarchycontroller.configmanagement.gke.io/v1alpha1 to hnc.x-k8s.io/v1alpha2. You can find the custom resources on your cluster by running the following command:

    kubectl get hierarchicalresourcequota.hierarchycontroller.configmanagement.gke.io --all-namespaces
    
  3. Re-apply the hierarchical resource quota resources.

  4. Delete the CRD for the Hierarchical Resource Quota from Hierarchy Controller:

    kubectl delete crd hierarchicalresourcequotas.hierarchycontroller.configmanagement.gke.io