diff --git a/apis/autoscaling/v1alpha1/mongodb_webhook.go b/apis/autoscaling/v1alpha1/mongodb_webhook.go index 61bcffad5a..946a1a8081 100644 --- a/apis/autoscaling/v1alpha1/mongodb_webhook.go +++ b/apis/autoscaling/v1alpha1/mongodb_webhook.go @@ -190,6 +190,14 @@ func (in *MongoDBAutoscaler) validate() error { if st.Standalone != nil { return errors.New("Spec.Storage.Standalone is invalid for sharded mongoDB") } + + if err = validateScalingRules(st.ConfigServer); err != nil { + return err + } + if err = validateScalingRules(st.Shard); err != nil { + return err + } + } else if mg.Spec.ReplicaSet != nil { if st.Standalone != nil { return errors.New("Spec.Storage.Standalone is invalid for replicaSet mongoDB") @@ -200,6 +208,10 @@ func (in *MongoDBAutoscaler) validate() error { if st.ConfigServer != nil { return errors.New("Spec.Storage.ConfigServer is invalid for replicaSet mongoDB") } + + if err = validateScalingRules(st.ReplicaSet); err != nil { + return err + } } else { if st.ReplicaSet != nil { return errors.New("Spec.Storage.Replicaset is invalid for Standalone mongoDB") @@ -213,6 +225,16 @@ func (in *MongoDBAutoscaler) validate() error { if st.Hidden != nil { return errors.New("Spec.Storage.Hidden is invalid for Standalone mongoDB") } + + if err = validateScalingRules(st.Standalone); err != nil { + return err + } + } + + if mg.Spec.Hidden != nil { + if err = validateScalingRules(st.Hidden); err != nil { + return err + } } } diff --git a/apis/autoscaling/v1alpha1/openapi_generated.go b/apis/autoscaling/v1alpha1/openapi_generated.go index 564f159373..b0fe6c47a4 100644 --- a/apis/autoscaling/v1alpha1/openapi_generated.go +++ b/apis/autoscaling/v1alpha1/openapi_generated.go @@ -552,9 +552,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.RedisSentinelOpsRequestOptions": schema_apimachinery_apis_autoscaling_v1alpha1_RedisSentinelOpsRequestOptions(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.RedisStorageAutoscalerSpec": schema_apimachinery_apis_autoscaling_v1alpha1_RedisStorageAutoscalerSpec(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.StorageAutoscalerSpec": schema_apimachinery_apis_autoscaling_v1alpha1_StorageAutoscalerSpec(ref), + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.StorageScalingRule": schema_apimachinery_apis_autoscaling_v1alpha1_StorageScalingRule(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.VPAStatus": schema_apimachinery_apis_autoscaling_v1alpha1_VPAStatus(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.VerticalPodAutopilotCondition": schema_apimachinery_apis_autoscaling_v1alpha1_VerticalPodAutopilotCondition(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.VerticalPodAutopilotRecommenderSelector": schema_apimachinery_apis_autoscaling_v1alpha1_VerticalPodAutopilotRecommenderSelector(ref), + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.quantity": schema_apimachinery_apis_autoscaling_v1alpha1_quantity(ref), } } @@ -26660,6 +26662,26 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_StorageAutoscalerSpec(ref com Format: "int32", }, }, + "scalingRules": { + SchemaProps: spec.SchemaProps{ + Description: "ScalingRules are to support more dynamic ScalingThreshold For example, Upto certain Size (GB) increase in %, after that increase in absolute value.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.StorageScalingRule"), + }, + }, + }, + }, + }, + "upperBound": { + SchemaProps: spec.SchemaProps{ + Description: "Set a max size limit for volume increase", + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, "expansionMode": { SchemaProps: spec.SchemaProps{ Description: "ExpansionMode can be `Online` or `Offline`", @@ -26672,6 +26694,36 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_StorageAutoscalerSpec(ref com Required: []string{"expansionMode"}, }, }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.StorageScalingRule"}, + } +} + +func schema_apimachinery_apis_autoscaling_v1alpha1_StorageScalingRule(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StorageScalingRule format:\n - appliesBelow: 500GB\n threshold: 30pc\n - appliesBelow: 1000GB\n threshold: 20pc\n - appliesBelow: \"\"\n threshold: 50GB\n\nNote that, `pc` & `%` both is supported", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "appliesUpto": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "threshold": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"appliesUpto", "threshold"}, + }, + }, } } @@ -26796,3 +26848,37 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_VerticalPodAutopilotRecommend }, } } + +func schema_apimachinery_apis_autoscaling_v1alpha1_quantity(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "InString": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "InQuantity": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + "Threshold": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"InString", "InQuantity", "Threshold"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} diff --git a/apis/autoscaling/v1alpha1/type.go b/apis/autoscaling/v1alpha1/type.go index 04c1ce078d..4b5d833107 100644 --- a/apis/autoscaling/v1alpha1/type.go +++ b/apis/autoscaling/v1alpha1/type.go @@ -22,6 +22,7 @@ import ( opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kmapi "kmodules.xyz/client-go/api/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -109,16 +110,37 @@ type StorageAutoscalerSpec struct { // If PVC usage percentage is less than the UsageThreshold, // we don't need to scale it. The Default is 80% - UsageThreshold int32 `json:"usageThreshold,omitempty"` + UsageThreshold *int32 `json:"usageThreshold,omitempty"` // If PVC usage percentage >= UsageThreshold, // we need to scale that by ScalingThreshold percentage. The Default is 50% - ScalingThreshold int32 `json:"scalingThreshold,omitempty"` + ScalingThreshold *int32 `json:"scalingThreshold,omitempty"` + + // ScalingRules are to support more dynamic ScalingThreshold + // For example, Upto certain Size (GB) increase in %, after that increase in absolute value. + ScalingRules []StorageScalingRule `json:"scalingRules,omitempty"` + + // Set a max size limit for volume increase + UpperBound resource.Quantity `json:"upperBound,omitempty"` // ExpansionMode can be `Online` or `Offline` ExpansionMode opsapi.VolumeExpansionMode `json:"expansionMode"` } +// StorageScalingRule format: +// - appliesBelow: 500GB +// threshold: 30pc +// - appliesBelow: 1000GB +// threshold: 20pc +// - appliesBelow: "" +// threshold: 50GB +// +// Note that, `pc` & `%` both is supported +type StorageScalingRule struct { + AppliesUpto string `json:"appliesUpto"` + Threshold string `json:"threshold"` +} + // AutoscalerStatus describes the runtime state of the autoscaler. type AutoscalerStatus struct { // Specifies the current phase of the autoscaler diff --git a/apis/autoscaling/v1alpha1/webhook_helpers.go b/apis/autoscaling/v1alpha1/webhook_helpers.go index 651b6ad1b5..384c49719a 100644 --- a/apis/autoscaling/v1alpha1/webhook_helpers.go +++ b/apis/autoscaling/v1alpha1/webhook_helpers.go @@ -17,10 +17,18 @@ limitations under the License. package v1alpha1 import ( + "fmt" + "sort" + "strconv" + "strings" + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1alpha2" core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" + "k8s.io/utils/ptr" ) func setDefaultStorageValues(storageSpec *StorageAutoscalerSpec) { @@ -30,12 +38,56 @@ func setDefaultStorageValues(storageSpec *StorageAutoscalerSpec) { if storageSpec.Trigger == "" { storageSpec.Trigger = AutoscalerTriggerOff } - if storageSpec.ScalingThreshold == 0 { - storageSpec.ScalingThreshold = DefaultStorageScalingThreshold + if storageSpec.ScalingThreshold == nil { + ptr.To(DefaultStorageScalingThreshold) + storageSpec.ScalingThreshold = ptr.To[int32](DefaultStorageScalingThreshold) + } + defaultScalingRules(storageSpec) +} + +type quantity struct { + InString string + InQuantity resource.Quantity + Threshold string +} + +func defaultScalingRules(storageSpec *StorageAutoscalerSpec) { + if storageSpec.UsageThreshold == nil { + storageSpec.UsageThreshold = ptr.To[int32](DefaultStorageUsageThreshold) + } + var quantities []quantity + var zeroQuantityThresholds []string + for _, sr := range storageSpec.ScalingRules { + if sr.AppliesUpto == "" { + zeroQuantityThresholds = append(zeroQuantityThresholds, sr.Threshold) + continue + } + quantities = append(quantities, quantity{ + InString: sr.AppliesUpto, + InQuantity: resource.MustParse(sr.AppliesUpto), + Threshold: "", + }) + } + + // Sort the quantities + sort.Slice(quantities, func(i, j int) bool { + return quantities[i].InQuantity.Cmp(quantities[j].InQuantity) < 0 + }) + + storageSpec.ScalingRules = make([]StorageScalingRule, 0) + for _, q := range quantities { + storageSpec.ScalingRules = append(storageSpec.ScalingRules, StorageScalingRule{ + AppliesUpto: q.InString, + Threshold: q.Threshold, + }) } - if storageSpec.UsageThreshold == 0 { - storageSpec.UsageThreshold = DefaultStorageUsageThreshold + for _, threshold := range zeroQuantityThresholds { + storageSpec.ScalingRules = append(storageSpec.ScalingRules, StorageScalingRule{ + AppliesUpto: "", + Threshold: threshold, + }) } + klog.Infof("scaling Rules = %v \n", storageSpec.ScalingRules) } func setDefaultComputeValues(computeSpec *ComputeAutoscalerSpec) { @@ -75,3 +127,36 @@ func setInMemoryDefaults(computeSpec *ComputeAutoscalerSpec, storageEngine dbapi computeSpec.InMemoryStorage.ScalingFactorPercentage = DefaultInMemoryStorageScalingFactorPercentage } } + +func validateScalingRules(storageSpec *StorageAutoscalerSpec) error { + var zeroQuantityThresholds []string + for _, sr := range storageSpec.ScalingRules { + if sr.AppliesUpto == "" { + zeroQuantityThresholds = append(zeroQuantityThresholds, sr.Threshold) + } + th := sr.Threshold + if strings.HasSuffix(th, "%") { + if !isNum(strings.TrimSuffix(th, "%")) { + return fmt.Errorf("%v is not a valid percentage value", th) + } + } else if strings.HasSuffix(th, "pc") { + if !isNum(strings.TrimSuffix(th, "pc")) { + return fmt.Errorf("%v is not a valid percentage value", th) + } + } else { + _, err := resource.ParseQuantity(sr.Threshold) + if err != nil { + return fmt.Errorf("%v is not a valid quatity", sr.Threshold) + } + } + } + if len(zeroQuantityThresholds) > 1 { + return fmt.Errorf("%v appliesBelow value are empty in %v", zeroQuantityThresholds, storageSpec.ScalingRules) + } + return nil +} + +func isNum(s string) bool { + _, err := strconv.Atoi(s) + return err == nil +} diff --git a/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go b/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go index 029eefce8f..e520d0b8d5 100644 --- a/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go +++ b/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go @@ -415,62 +415,62 @@ func (in *ElasticsearchStorageAutoscalerSpec) DeepCopyInto(out *ElasticsearchSto if in.Node != nil { in, out := &in.Node, &out.Node *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Master != nil { in, out := &in.Master, &out.Master *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Ingest != nil { in, out := &in.Ingest, &out.Ingest *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Data != nil { in, out := &in.Data, &out.Data *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.DataContent != nil { in, out := &in.DataContent, &out.DataContent *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.DataHot != nil { in, out := &in.DataHot, &out.DataHot *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.DataWarm != nil { in, out := &in.DataWarm, &out.DataWarm *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.DataCold != nil { in, out := &in.DataCold, &out.DataCold *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.DataFrozen != nil { in, out := &in.DataFrozen, &out.DataFrozen *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.ML != nil { in, out := &in.ML, &out.ML *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Transform != nil { in, out := &in.Transform, &out.Transform *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Coordinating != nil { in, out := &in.Coordinating, &out.Coordinating *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -835,17 +835,17 @@ func (in *KafkaStorageAutoscalerSpec) DeepCopyInto(out *KafkaStorageAutoscalerSp if in.Node != nil { in, out := &in.Node, &out.Node *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Broker != nil { in, out := &in.Broker, &out.Broker *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Controller != nil { in, out := &in.Controller, &out.Controller *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -1015,7 +1015,7 @@ func (in *MariaDBStorageAutoscalerSpec) DeepCopyInto(out *MariaDBStorageAutoscal if in.MariaDB != nil { in, out := &in.MariaDB, &out.MariaDB *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -1383,27 +1383,27 @@ func (in *MongoDBStorageAutoscalerSpec) DeepCopyInto(out *MongoDBStorageAutoscal if in.Standalone != nil { in, out := &in.Standalone, &out.Standalone *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.ReplicaSet != nil { in, out := &in.ReplicaSet, &out.ReplicaSet *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.ConfigServer != nil { in, out := &in.ConfigServer, &out.ConfigServer *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Shard != nil { in, out := &in.Shard, &out.Shard *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Hidden != nil { in, out := &in.Hidden, &out.Hidden *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -1573,7 +1573,7 @@ func (in *MySQLStorageAutoscalerSpec) DeepCopyInto(out *MySQLStorageAutoscalerSp if in.MySQL != nil { in, out := &in.MySQL, &out.MySQL *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -1769,7 +1769,7 @@ func (in *PerconaXtraDBStorageAutoscalerSpec) DeepCopyInto(out *PerconaXtraDBSto if in.PerconaXtraDB != nil { in, out := &in.PerconaXtraDB, &out.PerconaXtraDB *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -2151,7 +2151,7 @@ func (in *PostgresStorageAutoscalerSpec) DeepCopyInto(out *PostgresStorageAutosc if in.Postgres != nil { in, out := &in.Postgres, &out.Postgres *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -2841,17 +2841,17 @@ func (in *RedisStorageAutoscalerSpec) DeepCopyInto(out *RedisStorageAutoscalerSp if in.Standalone != nil { in, out := &in.Standalone, &out.Standalone *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } if in.Sentinel != nil { in, out := &in.Sentinel, &out.Sentinel *out = new(StorageAutoscalerSpec) - **out = **in + (*in).DeepCopyInto(*out) } return } @@ -2869,6 +2869,22 @@ func (in *RedisStorageAutoscalerSpec) DeepCopy() *RedisStorageAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageAutoscalerSpec) DeepCopyInto(out *StorageAutoscalerSpec) { *out = *in + if in.UsageThreshold != nil { + in, out := &in.UsageThreshold, &out.UsageThreshold + *out = new(int32) + **out = **in + } + if in.ScalingThreshold != nil { + in, out := &in.ScalingThreshold, &out.ScalingThreshold + *out = new(int32) + **out = **in + } + if in.ScalingRules != nil { + in, out := &in.ScalingRules, &out.ScalingRules + *out = make([]StorageScalingRule, len(*in)) + copy(*out, *in) + } + out.UpperBound = in.UpperBound.DeepCopy() return } @@ -2882,6 +2898,22 @@ func (in *StorageAutoscalerSpec) DeepCopy() *StorageAutoscalerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageScalingRule) DeepCopyInto(out *StorageScalingRule) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageScalingRule. +func (in *StorageScalingRule) DeepCopy() *StorageScalingRule { + if in == nil { + return nil + } + out := new(StorageScalingRule) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VPAStatus) DeepCopyInto(out *VPAStatus) { *out = *in diff --git a/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml b/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml index 584665f214..099ae5311e 100644 --- a/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml @@ -604,11 +604,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -622,11 +640,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -640,11 +676,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -658,11 +712,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -676,11 +748,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -694,11 +784,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -712,11 +820,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -730,11 +856,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -748,11 +892,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -766,11 +928,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -784,11 +964,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -802,11 +1000,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_kafkaautoscalers.yaml b/crds/autoscaling.kubedb.com_kafkaautoscalers.yaml index 8a712dee20..09cb2daa43 100644 --- a/crds/autoscaling.kubedb.com_kafkaautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_kafkaautoscalers.yaml @@ -206,11 +206,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -224,11 +242,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -242,11 +278,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml b/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml index ef33b55856..e360bb5aa6 100644 --- a/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml @@ -120,11 +120,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml b/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml index 63b98b8acf..07c8da1b50 100644 --- a/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml @@ -394,11 +394,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -412,11 +430,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -430,11 +466,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -448,11 +502,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -466,11 +538,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml b/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml index f5ade32fa6..493361f973 100644 --- a/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml @@ -120,11 +120,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml b/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml index afc4c66cab..e762cc3912 100644 --- a/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml @@ -120,11 +120,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_postgresautoscalers.yaml b/crds/autoscaling.kubedb.com_postgresautoscalers.yaml index 6a0cf05783..3f57f40d12 100644 --- a/crds/autoscaling.kubedb.com_postgresautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_postgresautoscalers.yaml @@ -118,11 +118,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer diff --git a/crds/autoscaling.kubedb.com_redisautoscalers.yaml b/crds/autoscaling.kubedb.com_redisautoscalers.yaml index e397775780..9e62ded424 100644 --- a/crds/autoscaling.kubedb.com_redisautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_redisautoscalers.yaml @@ -206,11 +206,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -224,11 +242,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer @@ -242,11 +278,29 @@ spec: - Offline - Online type: string + scalingRules: + items: + properties: + appliesUpto: + type: string + threshold: + type: string + required: + - appliesUpto + - threshold + type: object + type: array scalingThreshold: format: int32 type: integer trigger: type: string + upperBound: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true usageThreshold: format: int32 type: integer