This is a draft document that was built and uploaded automatically. It may document beta software and be incomplete or even incorrect. Use this document at your own risk.
The App-AutoScaler service is used for automatically managing an application's instance count when deployed on KubeCF. The scaling behavior is determined by a set of criteria defined in a policy (See Section 23.4, “Policies”).
Using the App-AutoScaler service requires:
A running deployment of kubecf
cf, the Cloud Foundry command line interface. For more information,
see https://docs.cloudfoundry.org/cf-cli/.
For SUSE Linux Enterprise and openSUSE systems, install using zypper.
tux > sudo zypper install cf-cliFor SLE, ensure the SUSE Cloud Application Platform Tools Module has been added. Add the module using YaST or SUSEConnect.
tux > SUSEConnect --product sle-module-cap-tools/15.1/x86_64For other systems, follow the instructions at https://docs.cloudfoundry.org/cf-cli/install-go-cli.html.
The Cloud Foundry CLI AutoScaler Plug-in, see https://github.com/cloudfoundry/app-autoscaler-cli-plugin
The plugin can be installed by running the following command:
tux > cf install-plugin -r CF-Community app-autoscaler-pluginIf the plugin repo is not found, add it first:
tux > cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
App-AutoScaler is disabled by default. To enable it, add the following
block to your kubecf-config-values.yaml file.
features:
autoscaler:
enabled: true
To disable App-AutoScaler again, update the above block in your kubecf-config-values.yaml
so that enabled is set to false.
After making the change above, and any other configuration changes, apply the update by doing the following:
For an initial deployment, continue to the deployment steps for your platform:
For SUSE CaaS Platform, see Section 4.13, “Deploying SUSE Cloud Application Platform”.
For Microsoft AKS, see Section 5.13, “Deploying SUSE Cloud Application Platform”.
For Amazon EKS, see Section 6.13, “Deploying SUSE Cloud Application Platform”.
For Google GKE, see Section 7.14, “Deploying SUSE Cloud Application Platform”.
For an existing deployment, use helm upgrade to apply
the change.
tux > helm upgrade kubecf suse/kubecf \
--namespace kubecf \
--values kubecf-config-values.yaml \
--version 2.7.13Push the application without starting it first:
tux > cf push MY_APPLICATION --no-startAttach autoscaling policy to the application:
tux > cf attach-autoscaling-policy MY_APPLICATION MY_POLICY.jsonThe policy is defined as a JSON file (See Section 23.4, “Policies”) in a proper format (See https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/policy.md).
Start the application:
tux > cf start MY_APPLICATIONAutoscaling policies can be managed using cf CLI with the App-AutoScaler plugin as above (See Section 23.3.1, “The App-AutoScaler cf CLI Plugin”) or using the App-AutoScaler API (See Section 23.3.2, “App-AutoScaler API”).
The App-AutoScaler plugin is used for managing the service with your applications and provides the following commands (with shortcuts in brackets). Refer to https://github.com/cloudfoundry/app-autoscaler-cli-plugin#command-list for details about each command:
Set or view AutoScaler service API endpoint. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-autoscaling-api for more information.
Retrieve the scaling policy of an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-autoscaling-policy for more information.
Attach a scaling policy to an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-attach-autoscaling-policy for more information.
Detach the scaling policy from an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-detach-autoscaling-policy for more information.
Create custom metric credential for an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-create-autoscaling-credential for more information.
Delete the custom metric credential of an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-delete-autoscaling-credential for more information.
Retrieve the metrics of an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-autoscaling-metrics for more information.
Retrieve the scaling history of an application. See https://github.com/cloudfoundry/app-autoscaler-cli-plugin#cf-autoscaling-history for more information.
The App-AutoScaler service provides a Public API with detailed usage information, see https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst. It includes requests to:
List scaling history of an application. For details, refer to https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst#list-scaling-history-of-an-application
List instance metrics of an application. For details, refer to https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst#list-instance-metrics-of-an-application
List aggregated metrics of an application. For details, refer to https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst#list-aggregated-metrics-of-an-application
Policy api. For details, refer to https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst#policy-api
Delete policy. For details, refer to https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst#delete-policy
Get policy. For details, refer to https://github.com/cloudfoundry/app-autoscaler/blob/develop/docs/Public_API.rst#get-policy
A policy identifies characteristics including minimum instance count, maximum instance count, and the rules used to determine when the number of application instances is scaled up or down. These rules are categorized into two types, scheduled scaling and dynamic scaling. (See Section 23.4.1, “Scaling Types”). Multiple scaling rules can be specified in a policy, but App-AutoScaler does not detect or handle conflicts that may occur. Ensure there are no conflicting rules to avoid unintended scaling behavior.
Policies are defined using the JSON format and can be attached to an application either by passing the path to the policy file or directly as a parameter.
The following is an example of a policy file, called
my-policy.json.
{
"instance_min_count": 1,
"instance_max_count": 4,
"scaling_rules": [{
"metric_type": "memoryused",
"stat_window_secs": 60,
"breach_duration_secs": 60,
"threshold": 10,
"operator": ">=",
"cool_down_secs": 300,
"adjustment": "+1"
}]
}For an example that demonstrates defining multiple scaling rules in a single policy, refer to the sample of a policy file at https://github.com/cloudfoundry/app-autoscaler/blob/develop/src/integration/fakePolicyWithSchedule.json. The complete list of configurable policy values can be found at https://github.com/cloudfoundry/app-autoscaler/blob/master/docs/policy.md.
Modifies an application's instance count at a predetermined time. This option is suitable for workloads with predictable resource usage.
Modifies an application's instance count based on metrics criteria. This option is suitable for workloads with dynamic resource usage. The following metrics are available:
memoryused
memoryutil
cpu
responsetime
throughput
custom metric
See https://github.com/cloudfoundry/app-autoscaler/tree/develop/docs#scaling-type for additional details.