When you create an application deployed in Kubernetes mode in the Enterprise Distributed Application Service (EDAS)console, EDAS provides the default Horizontal Pod Autoscaling (HPA) configuration. You can choose whether to enable the default Auto Scaling configuration. This topic describes how to enable the default Auto Scaling configuration in the EDAS console.

Background information

If you do not set the number of reserved CPU cores or the quota of the number of CPU cores when you create an application deployed in Kubernetes mode in the EDAS console, the default Auto Scaling configuration cannot be enabled. If you set the number of reserved CPU cores and the quota of the number of CPU cores, the Auto Scaling configuration is enabled by default. You can manually disable the Auto Scaling configuration.

When you create an application, if you set the number of reserved CPU cores and the quota of the number of CPU cores and the Auto Scaling configuration is enabled by default, the HPA configuration is enabled. 80& of the average CPU utilization or memory usage triggers HPA. The maximum number of replicas is twice the number of the set number of pods, and the minimum number of replicas is the set number of pods.

Note
  • Assume that a service is added to an application and a Server Load Balancer (SLB) instance is bound to the application. When auto scaling occurs, EDAS automatically adds application instances that are scaled out to a list of backend servers and removes application instances that are scaled in from the list.
  • Assume that persistent storage is configured for an application. When auto scaling occurs, EDAS automatically associates application instances that are scaled out with the configured persistent storage.

Enable the default Auto Scaling configuration

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a namespace in the upper part and click Create Application in the upper-left corner.
  3. In the Basic Information step, specify Cluster Type and Application Runtime Environment, and click Next.
    Parameter Description
    Cluster Type Select Kubernetes Clusters.
    Application Runtime Environment Select an application runtime environment based on the type of the hosted application.
    • Java
      • Custom: Select this option if you want to use a custom image to deploy the application in a Kubernetes cluster.
      • Java: Select this option if you want to use a universal JAR package to deploy the application as a Dubbo or a Spring Boot application. You can specify the Java Environment parameter after you select this option.
      • Tomcat: Select this option if you want to use a universal WAR package to deploy the application as a Dubbo or a Spring application. You can specify the Java Environment and Container Version parameters after you select this option.
      • EDAS-Container (HSF): Select this option if you want to use a WAR or FatJar package to deploy the application as a High-Speed Service Framework (HSF) application. You can specify the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.
    • PHP: Select this option if you want to run this application as a PHP application on Apache HTTP Server.
    • Node.js, C ++, Go, and Other Languages: Select this option if you want to use a custom image to deploy the application in a Kubernetes cluster. The configuration process for multi-language applications is not described in this topic. For more information, see Use custom images to deploy applications of different programming languages in Kubernetes clusters.
  4. On the Configurations tab, configure the environment information, basic information, and deployment mode for the application, set the related resource parameters, and then click Next.
    If you want to enable the default Auto Scaling configuration, you must set the number of reserved CPU cores and the quota of the number of CPU cores. Otherwise, the default Auto Scaling configuration cannot be enabled. Configurations-reserved CPU and limit that must be set
  5. On the Advanced Settings tab, expand Scaling Settings and choose whether to enable the default Auto Scaling configuration.
    If you want to automatically configure HPA, enable Horizontal Scaling Feature for Container Group. Whether to enable the default Auto Scaling configuration
    Parameter Description
    Metric Select CPU Utilization or Memory Usage.
    Trigger Condition The trigger condition of Auto Scaling. Default value: 80%.
    Maximum Replicas The maximum number of pods that can be scaled out. The default value is twice the number of pods.
    Minimum Replicas The minimum number of pods that can be scaled down. The default value is the number of pods.
  6. Click Create Application.
  7. In the Creation Completed step, confirm the settings in Basic Information, Configurations, and Advanced Settings, and click Create Application.
    In the upper part of the Application Overview page, click View Details. On the Change List page, you can view the change process. Wait a few minutes until the application is deployed. After the change process is complete, view the running status of the instances in the Basic Information section of the Application Overview page. If the pod that runs the application is in the running state, the application is deployed.

View the configurations of default Auto Scaling

  1. In the left-side navigation pane, choose Application Settings > Auto Scaling.
  2. View the configurations of default Auto Scaling.
    Default Auto Scaling that is configuredOn the page of default Auto Scaling that is configured, you can edit, start, stop, and delete default Auto Scaling in the upper-right corner. You can also view the event details of the Auto Scaling records.