From 5791d0117eb84feda74468e1ed432a7d95b8a09b Mon Sep 17 00:00:00 2001 From: Cesar Wong Date: Fri, 21 Nov 2025 14:09:51 -0500 Subject: [PATCH] docs: add resource-based control plane autoscaling guide Add comprehensive documentation for resource-based control plane autoscaling feature, including prerequisites, configuration, and troubleshooting steps. Signed-off-by: Cesar Wong Assisted-by: Composer (via Cursor) --- ...esource-based-control-plane-autoscaling.md | 239 ++++++++++++++++++ docs/mkdocs.yml | 1 + 2 files changed, 240 insertions(+) create mode 100644 docs/content/how-to/resource-based-control-plane-autoscaling.md diff --git a/docs/content/how-to/resource-based-control-plane-autoscaling.md b/docs/content/how-to/resource-based-control-plane-autoscaling.md new file mode 100644 index 00000000000..1853d58f308 --- /dev/null +++ b/docs/content/how-to/resource-based-control-plane-autoscaling.md @@ -0,0 +1,239 @@ +# Resource-Based Control Plane Autoscaling + +Resource-based control plane autoscaling enables automatic sizing of HostedClusters based on actual Kube API server resource usage rather than worker node count. This feature uses Vertical Pod Autoscaler (VPA) recommendations to determine the optimal cluster size class for a HostedCluster. + +## Platform Support + +**Important**: This feature is only available for HostedClusters using the request serving isolation architecture on AWS. The feature requires the `dedicated-request-serving-components` topology annotation to be set on the HostedCluster. + +## Prerequisites + +Before enabling resource-based control plane autoscaling, ensure the following prerequisites are met: + +### VPA Operator + +The Vertical Pod Autoscaler operator must be installed on the management cluster via Operator Lifecycle Manager (OLM). The VPA operator only supports the `OwnNamespace` install mode, so it must be installed in its own namespace. + +#### Step 1: Create the VPA Namespace + +Create the namespace for the VPA operator: + +```bash +kubectl create namespace openshift-vertical-pod-autoscaler +``` + +#### Step 2: Create the OperatorGroup + +Create an OperatorGroup that targets only the VPA namespace: + +```bash +kubectl apply -f - <= VPA_recommended_memory +``` + +## How It Works + +1. When resource-based autoscaling is enabled, the HyperShift operator creates a `VerticalPodAutoscaler` resource targeting the `kube-apiserver` deployment in the control plane namespace. + +2. The VPA monitors the kube-apiserver container's resource usage and generates memory recommendations. + +3. The autoscaler controller reads the VPA recommendations and determines the appropriate cluster size class based on: + - The VPA's memory recommendation for the kube-apiserver container + - The machine memory capacity for each size class (from `ClusterSizingConfiguration`) + - The configured `kubeAPIServerMemoryFraction` + +4. The controller sets the `hypershift.openshift.io/recommended-cluster-size` annotation on the HostedCluster with the recommended size. + +5. The hosted cluster sizing controller uses this recommendation (along with other factors) to determine the actual cluster size applied to the HostedCluster. + +## Monitoring + +You can monitor the autoscaling behavior by checking: + +- The `hypershift.openshift.io/recommended-cluster-size` annotation on the HostedCluster +- The VPA resource status in the control plane namespace: `kubectl get vpa kube-apiserver -n ` +- The VPA recommendation conditions and container recommendations + +## Troubleshooting + +If the recommended cluster size is not being set: + +1. Verify that both required annotations are present on the HostedCluster +2. Check that the VPA operator is installed and the VPA controller instance exists +3. Verify that the VPA resource exists in the control plane namespace and has valid recommendations +4. Ensure the `ClusterSizingConfiguration` has size configurations with capacity specifications +5. Check controller logs for errors related to size cache updates or VPA reconciliation + diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 1a024c270cc..03a20b842f7 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -66,6 +66,7 @@ nav: - how-to/distribute-hosted-cluster-workloads.md - how-to/upgrades.md - how-to/restart-control-plane-components.md + - how-to/resource-based-control-plane-autoscaling.md - how-to/pause-reconciliation.md - how-to/per-hostedcluster-dashboard.md - how-to/metrics-sets.md