Enable Metrics-server for HPA

Edit

Introduction to HPA

KubeSphere supports setting Honrizontal Pod Autoscaler for Deployment based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics). When the request and traffic surges, the Pod number can be autoscaled in Kubernetes cluster, which can improve the stability of the system. You are supposed to install metrics-server to Enable HPA.

Enable HPA before Installation

Metrics-server requires at least 5m of CPU request and 44.35M of memory request. Please make sure your cluster has enough resource.

Before executing installation, you can set metrics_server_enabled to true, then you can back to All-in-One or Multi-Node guide to continue installation.

  1. # Following components are all optional for KubeSphere,
  2. # Which could be turned on to install it before installation or later by updating its value to true
  3. ···
  4. metrics_server_enabled: true

Enable Metrics-server after Installation

If you already have set up KubeSphere without enabling metrics server, you still can edit the ConfigMap of ks-installer using the following command.

  1. kubectl edit cm -n kubesphere-system ks-installer

Then set metrics-server from False to True.

  1. ···
  2. metrics-server:
  3. enabled: True

Save it and exit, it will be installed automatically. You can inspect the logs of ks-installer Pod to verify the installation status, and wait for the successful result logs output.