Find reference information about the parameters that you set to configure Tanzu Service Mesh Service Autoscaler. Also find reference information about the metrics you can use with the autoscaler.
You can set Tanzu Service Mesh Service Autoscaler parameters using a Kubernetes Custom Resource. The following example shows a custom resource and explains the possible configuration properties that you apply to an onboarded cluster. The kind
as defined in the Custom Resource Definition (CRD) for this autoscaler is Definition
or asd
for short under the autoscaling.tsm.tanzu.vmware.com/v1alpha1 API group.
You can configure Tanzu Service Mesh Service Autoscaler through the Definition custom resource manifest file. Shown here is frontend-asd.yaml, an example Definition custom resource manifest for a single microservice. The spec
section of this example contains all the possible configuration properties unique to the autoscaler.
apiVersion: autoscaling.tsm.tanzu.vmware.com/v1alpha1 kind: Definition metadata: name: frontend-asd namespace: acme labels: app: frontend spec: scaleTargetRef: kubernetes: apiVersion: apps/v1 kind: Deployment name: frontend scaleRule: mode: EFFICIENCY enabled: true instances: min: 1 max: 10 default: 5 stepsDown: 2 stepsUp: 3 trigger: gracePeriodSeconds: 300 metric: name: CPUUsageMillicores scaleUp: 500 scaleDown: 100 windowSeconds: 600
Every property in the spec
section of the Definition custom resource is a configuration unique to the Tanzu Service Mesh Service Autoscaler. The following table describes the configurable properties in the spec
section of the custom resource. The table also includes a few fields from the metadata
section and explains their values.
Custom Resource Property |
Required/Optional |
Description |
---|---|---|
|
Optional |
Name of this custom resource. |
|
Optional |
When the custom resource is applied, it will be on the namespace specified here. |
|
Optional |
Labels can be used to organize and select subsets of objects. |
|
Required |
Describes the Kubernetes resource that is being adjusted. Options: Deployment, ReplicaSet, or StatefulSet. |
|
Required |
Name of the Kubernetes resource being scaled within the same namespace.
Important:
Ensure that there is only one autoscaling definition per service with this |
|
Optional |
API version for the Kubernetes resource, for example, apps/v1 for the deployment resource set in |
|
Required |
Determines if services will be scaling up only (performance) or scaling up and down (efficiency). Options: |
|
Required |
Determines if the autoscaler will change the number of running service instances. Options: If |
|
Required |
The minimum number of service instances that the autoscaler is allowed to set. Must be an integer between 1 and 1000, inclusive. |
|
Required |
The maximum number of service instances that the autoscaler is allowed to set. Must be an integer between 1 and 1000, inclusive. |
|
Optional |
Scale instances based on the steps is set here. If |
|
Optional |
Scale instances based on the steps to scale down set here. If |
|
Optional |
The default instance number is used when the autoscaler has insufficient information on the service instances running. In such a case, if the current number of instances is less than the default number of instances, scaling up is triggered. This value must be an integer between |
|
Optional |
The minimum amount of time that must pass before a scale-down action happens after any scaling event. The default is 300 (in seconds), but you can set any positive integer or 0. During the grace period, the autoscaler does not initiate a scale-down if the last scaling action was within the grace time window. Scale-up actions are not affected by the grace period. Setting a grace period of 0 deactivates the grace period for this object, that is, allows for immediate scale-down actions. |
|
Required |
The metric that scaling decisions are based on. For options, refer to the For more information, see the spec.scaleRule.trigger.metric.name section in Tanzu Service Mesh Autoscaler Configuration Details. |
|
Required |
This integer value determines the threshold that is used per service instance to initiate a scale-up action. The value can be either a percent or absolute number, depending on the |
|
Required |
This integer value determines the threshold that is used per service instance to initiate a scale-down action. The value can be either a percent or absolute number, depending on the |
|
Optional |
Metrics are based on an average over a certain period. You set this period, or “look-back” window, here. The number (integer) can be between 60 and 3600 seconds, inclusive. The default is 600 seconds or ten minutes. |
Tanzu Service Mesh Autoscaler Configuration Properties in the Tanzu Service Mesh Console UI
You can configure a Tanzu Service Mesh Service autoscaler through the Tanzu Service Mesh Console UI. Shown here is an example Autoscaling window for a GNS-scoped autoscaler. This example describes all fields that are supported by the autoscaler through the UI.
The following table describes the property fields that you use to configure an autoscaling policy in the Tanzu Service Mesh Console UI.
Field Name |
Required/Optional |
Description |
---|---|---|
Autoscaling Policy Name |
Required |
Name of this autoscaling policy |
Description |
Optional |
A brief description of the autoscaling policy |
GNS Scope (Global Namespace Scope) |
Required |
When the autoscaling policy is applied, it will be scoped to the global namespace specified here. |
Labels |
Optional |
Labels can be used to organize and select subsets of objects. |
Target Service |
Required |
Name of the microservice being scaled within the global namespace. |
Service Version |
Required |
Autoscaling configurations must target a service version in Tanzu Service Mesh that corresponds to specific Deployment, StatefulSet, or ReplicaSet in Kubernetes.
Warning:
Ensure that there is only one autoscaling definition per service. |
Autoscaling mode |
Required |
Determines if the service will scale up only (Performance mode) or scale up and down (Efficiency mode). Options: EFFICIENCY or PERFORMANCE. |
Autoscaling metric |
Required |
The metric that scaling decisions are based on. For the available metrics, see the Metric Type column in the Autoscaler Metric Reference section. For more information, see the spec.scaleRule.trigger.metric.name section in Tanzu Service Mesh Service Autoscaler Configuration Details. |
Scale Up Condition |
Required |
This integer value determines the threshold that is used per service instance to initiate a scale-up action. The value can be either a percent or absolute number, depending on the autoscaling metric. The value set for Scale Up condition must be greater than the value of Scale Down condition. For more information about the metrics that are available for autoscaling, see the Autoscaling Metrics Reference section. |
Scale Down Condition |
Required |
This integer value determines the threshold that is used per service instance to initiate a scale-down action. The value can be either a percent or absolute number, depending on the autoscaling metric that is set. Percentage values must be between 1 and 100. Scale down condition must be less than the value of scale up condition. For more information about the metrics that are available for autoscaling, see the Autoscaling Metrics Reference section. |
Min Instance Count |
Required |
The minimum number of service instances that the autoscaler is allowed to set. Must be an integer between 1 and 1000. |
Max Instance Count |
Required |
The maximum number of service instances that the autoscaler is allowed to set. Must be an integer between 1 and 1000. |
Stepped Scaling Method |
Optional |
Scale instances based on the steps is set here. |
TSM Default Autoscaling |
Optional |
The default number of instances to use when the autoscaler has insufficient information on the service instances running. In such a case, if the current number of instances is less than the default number of instances, scaling up is triggered. This value must be an integer between the |
Autoscaler Metrics Reference
The following table shows what metrics can be used with Tanzu Service Mesh Service Autoscaler. All values are integers. Metrics are averaged across all instances of a service.
Metric Type |
Unit |
Description |
Example |
---|---|---|---|
|
millicores |
CPU usage in millicores of the whole pod. Must be 1 or greater. |
40 |
|
percent |
CPU usage as a percent of what is specified in |
50 |
|
percent |
Memory usage as a percent of what is specified in |
80 |
|
bytes |
Memory usage in bytes of the whole pod. Must be 1 or greater. |
118093859 |
|
per second |
Number of requests made to the service in one second. |
30 |
|
count |
Number of requests made to the service during the metric time window set in |
366 |
|
milliseconds |
The 50th percentile latency. Fifty percent of all requests to the service take less time (measured in milliseconds) than the value (in milliseconds) set for this metric. Value must be 1 or greater. For more information, see the spec.scaleRule.trigger.metric.namesection in Tanzu Service Mesh Service Autoscaler Configuration Details. |
589 |
|
milliseconds |
The 90th percentile latency. Ninety percent of all requests to the service take less time (measured in milliseconds) than the value (in milliseconds) set for this metric. Value must be 1 or greater. For more information, see the |
956 |
|
milliseconds |
The 99th percentile latency. Ninety-nine percent of all requests to the service take less time (measured in milliseconds) than the value (in milliseconds) set for this metric. Value must be 1 or greater. For more information, see the spec.scaleRule.trigger.metric.name section in Tanzu Service Mesh Service Autoscaler Configuration Details. |
1541 |
Autoscaling API Reference
This table provides a brief summary of the autoscaling endpoints and HTTP methods in Tanzu Service Mesh Rest API.
HTTP Method |
Endpoint |
Description |
---|---|---|
PUT Autoscaling Policy |
PUT /v1alpha1/global-namespaces/{gnsID}/autoscaling-policies/{policyID} |
Edit the configuration of an autoscaling policy with a given ID (name) in a given global namespace. |
GET Autoscaling Policy |
GET /v1alpha1/global-namespaces/{gnsID}/autoscaling-policies/{policyID} |
Retrieve a list of existing autoscaling policies with a given ID (name) in a given global namespace. |
DELETE Autoscaling Policy |
DELETE /v1alpha1/global-namespaces/{gnsID}/autoscaling-policies/{policyID} |
Delete an autoscaling policy with a given ID (name) in a given global namespace. |
GET All Autoscaling Policies |
GET /v1alpha1/global-namespaces/{gnsID}/autoscaling-policies |
Retrieve all autoscaling policies in a given global namespace or for a particular service in the global namespace. |
GET Autoscaling Policy by Service |
GET /v1alpha1/global-namespaces/{gnsID}/autoscaling-policies?name={svcName}&kind={serviceVersion} |
Retrieve an autoscaling policy with a given service name and service version in a given global namespace. |