You are looking at the documentation of a prior release. To read the documentation of the latest release, please
visit here.
New to KubeDB? Please start here.
SingleStoreAutoscaler
What is SingleStoreAutoscaler
SingleStoreAutoscaler is a Kubernetes Custom Resource Definitions (CRD). It provides a declarative configuration for autoscaling SingleStore compute resources and storage of database components in a Kubernetes native way.
SingleStoreAutoscaler CRD Specifications
Like any official Kubernetes resource, a SingleStoreAutoscaler has TypeMeta, ObjectMeta, Spec and Status sections.
Here, some sample SingleStoreAutoscaler CROs for autoscaling different components of database is given below:
Sample SingleStoreAutoscaler for cluster database:
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: SinglestoreAutoscaler
metadata:
name: sdb-as-cluster
namespace: demo
spec:
databaseRef:
name: sdb-sample
storage:
leaf:
trigger: "On"
usageThreshold: 30
scalingThreshold: 50
expansionMode: "Offline"
upperBound: "100Gi"
aggregator:
trigger: "On"
usageThreshold: 40
scalingThreshold: 50
expansionMode: "Offline"
upperBound: "100Gi"
compute:
aggregator:
trigger: "On"
podLifeTimeThreshold: 5m
minAllowed:
cpu: 900m
memory: 3000Mi
maxAllowed:
cpu: 2000m
memory: 6Gi
controlledResources: ["cpu", "memory"]
resourceDiffPercentage: 10
leaf:
trigger: "On"
podLifeTimeThreshold: 5m
minAllowed:
cpu: 900m
memory: 3000Mi
maxAllowed:
cpu: 2000m
memory: 6Gi
controlledResources: ["cpu", "memory"]
resourceDiffPercentage: 10
Sample SingleStoreAutoscaler for standalone database:
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: SinglestoreAutoscaler
metadata:
name: sdb-as-standalone
namespace: demo
spec:
databaseRef:
name: sdb-standalone
storage:
node:
trigger: "On"
usageThreshold: 40
scalingThreshold: 50
expansionMode: "Offline"
upperBound: "100Gi"
compute:
node:
trigger: "On"
podLifeTimeThreshold: 5m
minAllowed:
cpu: 900m
memory: 3000Mi
maxAllowed:
cpu: 2000m
memory: 6Gi
controlledResources: ["cpu", "memory"]
resourceDiffPercentage: 10
Here, we are going to describe the various sections of a SingleStoreAutoscaler crd.
A SingleStoreAutoscaler object has the following fields in the spec section.
spec.databaseRef
spec.databaseRef is a required field that point to the SingleStore object for which the autoscaling will be performed. This field consists of the following sub-field:
- spec.databaseRef.name : specifies the name of the SingleStore object.
spec.opsRequestOptions
These are the options to pass in the internally created opsRequest CRO. opsRequestOptions has three fields. They have been described in details here.
spec.compute
spec.compute specifies the autoscaling configuration for the compute resources i.e. cpu and memory of the database components. This field consists of the following sub-field:
spec.compute.standaloneindicates the desired compute autoscaling configuration for a standalone SingleStore database.spec.compute.aggregatorindicates the desired compute autoscaling configuration for aggregator node of cluster mode.spec.compute.leafindicates the desired compute autoscaling configuration for the leaf node of cluster mode.
All of them has the following sub-fields:
triggerindicates if compute autoscaling is enabled for this component of the database. If “On” then compute autoscaling is enabled. If “Off” then compute autoscaling is disabled.minAllowedspecifies the minimal amount of resources that will be recommended, default is no minimum.maxAllowedspecifies the maximum amount of resources that will be recommended, default is no maximum.controlledResourcesspecifies which type of compute resources (cpu and memory) are allowed for autoscaling. Allowed values are “cpu” and “memory”.containerControlledValuesspecifies which resource values should be controlled. Allowed values are “RequestsAndLimits” and “RequestsOnly”.resourceDiffPercentagespecifies the minimum resource difference between recommended value and the current value in percentage. If the difference percentage is greater than this value than autoscaling will be triggered.podLifeTimeThresholdspecifies the minimum pod lifetime of at least one of the pods before triggering autoscaling.
spec.storage
spec.compute specifies the autoscaling configuration for the storage resources of the database components. This field consists of the following sub-field:
spec.compute.standaloneindicates the desired storage autoscaling configuration for a standalone SingleStore database.spec.compute.leafindicates the desired storage autoscaling configuration for leaf node of cluster mode.spec.compute.aggregatorindicates the desired storage autoscaling configuration for aggregator node of cluster mode.
All of them has the following sub-fields:
triggerindicates if storage autoscaling is enabled for this component of the database. If “On” then storage autoscaling is enabled. If “Off” then storage autoscaling is disabled.usageThresholdindicates usage percentage threshold, if the current storage usage exceeds then storage autoscaling will be triggered.scalingThresholdindicates the percentage of the current storage that will be scaled.expansionModeindicates the volume expansion mode.






























