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:
hierarchyController.enablePodTreeLabels
: iftrue
, and you use hierarchical observability, don't proceed with the steps on this page. Instead, reach out to Cloud Customer Care for help migrating to an alternative.hierarchyController.enabled:
iftrue
, do the following:
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:
Install the HNC hierarchical resource quotas by installing the
hrq.yaml
file underReleases
>Assets
.To migrate the existing hierarchical resource quota custom resources, change the
apiVersion
field fromhierarchycontroller.configmanagement.gke.io/v1alpha1
tohnc.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
Re-apply the hierarchical resource quota resources.
Delete the CRD for the Hierarchical Resource Quota from Hierarchy Controller:
kubectl delete crd hierarchicalresourcequotas.hierarchycontroller.configmanagement.gke.io