diff --git a/apis/autoscaling/v1alpha1/elasticsearch_types.go b/apis/autoscaling/v1alpha1/elasticsearch_types.go index 7f9a2afc3c..da5a8afffe 100644 --- a/apis/autoscaling/v1alpha1/elasticsearch_types.go +++ b/apis/autoscaling/v1alpha1/elasticsearch_types.go @@ -71,7 +71,7 @@ type ElasticsearchAutoscalerSpec struct { type ElasticsearchComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` Node *ComputeAutoscalerSpec `json:"node,omitempty"` Master *ComputeAutoscalerSpec `json:"master,omitempty"` diff --git a/apis/autoscaling/v1alpha1/mariadb_types.go b/apis/autoscaling/v1alpha1/mariadb_types.go index ecf94125e7..a7555eeac4 100644 --- a/apis/autoscaling/v1alpha1/mariadb_types.go +++ b/apis/autoscaling/v1alpha1/mariadb_types.go @@ -69,7 +69,7 @@ type MariaDBAutoscalerSpec struct { type MariaDBComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` MariaDB *ComputeAutoscalerSpec `json:"mariadb,omitempty"` } diff --git a/apis/autoscaling/v1alpha1/mongodb_types.go b/apis/autoscaling/v1alpha1/mongodb_types.go index 25715cacbb..c3d32b8d95 100644 --- a/apis/autoscaling/v1alpha1/mongodb_types.go +++ b/apis/autoscaling/v1alpha1/mongodb_types.go @@ -69,7 +69,7 @@ type MongoDBAutoscalerSpec struct { type MongoDBComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` Standalone *ComputeAutoscalerSpec `json:"standalone,omitempty"` ReplicaSet *ComputeAutoscalerSpec `json:"replicaSet,omitempty"` diff --git a/apis/autoscaling/v1alpha1/mysql_types.go b/apis/autoscaling/v1alpha1/mysql_types.go index ffe90145be..83280fe82a 100644 --- a/apis/autoscaling/v1alpha1/mysql_types.go +++ b/apis/autoscaling/v1alpha1/mysql_types.go @@ -71,7 +71,7 @@ type MySQLAutoscalerSpec struct { type MySQLComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` MySQL *ComputeAutoscalerSpec `json:"mysql,omitempty"` } diff --git a/apis/autoscaling/v1alpha1/openapi_generated.go b/apis/autoscaling/v1alpha1/openapi_generated.go index c2e25befde..077e8bdd34 100644 --- a/apis/autoscaling/v1alpha1/openapi_generated.go +++ b/apis/autoscaling/v1alpha1/openapi_generated.go @@ -486,6 +486,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.MySQLComputeAutoscalerSpec": schema_apimachinery_apis_autoscaling_v1alpha1_MySQLComputeAutoscalerSpec(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.MySQLOpsRequestOptions": schema_apimachinery_apis_autoscaling_v1alpha1_MySQLOpsRequestOptions(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.MySQLStorageAutoscalerSpec": schema_apimachinery_apis_autoscaling_v1alpha1_MySQLStorageAutoscalerSpec(ref), + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology": schema_apimachinery_apis_autoscaling_v1alpha1_NodeTopology(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.PerconaXtraDBAutoscaler": schema_apimachinery_apis_autoscaling_v1alpha1_PerconaXtraDBAutoscaler(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.PerconaXtraDBAutoscalerList": schema_apimachinery_apis_autoscaling_v1alpha1_PerconaXtraDBAutoscalerList(ref), "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.PerconaXtraDBAutoscalerSpec": schema_apimachinery_apis_autoscaling_v1alpha1_PerconaXtraDBAutoscalerSpec(ref), @@ -22473,9 +22474,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_ElasticsearchComputeAutoscale SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "node": { @@ -22542,7 +22543,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_ElasticsearchComputeAutoscale }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -23106,9 +23107,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MariaDBComputeAutoscalerSpec( SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "mariadb": { @@ -23120,7 +23121,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MariaDBComputeAutoscalerSpec( }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -23586,9 +23587,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MongoDBComputeAutoscalerSpec( SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "standalone": { @@ -23630,7 +23631,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MongoDBComputeAutoscalerSpec( }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -23849,9 +23850,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MySQLComputeAutoscalerSpec(re SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "mysql": { @@ -23863,7 +23864,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MySQLComputeAutoscalerSpec(re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -23919,6 +23920,39 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_MySQLStorageAutoscalerSpec(re } } +func schema_apimachinery_apis_autoscaling_v1alpha1_NodeTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the NodeTopology object", + Type: []string{"string"}, + Format: "", + }, + }, + "scaleUpDiffPercentage": { + SchemaProps: spec.SchemaProps{ + Description: "ScaleUpDiffPercentage describes in which difference (between recommended resource and the capacity of the nodePool) the opsReq should be triggered while scaling up Defaults to 15", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "scaleDownDiffPercentage": { + SchemaProps: spec.SchemaProps{ + Description: "ScaleDownDiffPercentage describes in which difference (between recommended resource and the capacity of the nodePool) the opsReq should be triggered while scaling down Defaults to 25", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + func schema_apimachinery_apis_autoscaling_v1alpha1_PerconaXtraDBAutoscaler(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -24063,9 +24097,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_PerconaXtraDBComputeAutoscale SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "perconaxtradb": { @@ -24077,7 +24111,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_PerconaXtraDBComputeAutoscale }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -24604,9 +24638,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_PostgresComputeAutoscalerSpec SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "postgres": { @@ -24618,7 +24652,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_PostgresComputeAutoscalerSpec }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -24806,9 +24840,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_ProxySQLComputeAutoscalerSpec SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "proxysql": { @@ -24820,7 +24854,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_ProxySQLComputeAutoscalerSpec }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -25106,9 +25140,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_RedisComputeAutoscalerSpec(re SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "standalone": { @@ -25130,7 +25164,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_RedisComputeAutoscalerSpec(re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } @@ -25299,9 +25333,9 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_RedisSentinelComputeAutoscale SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeTopologyRef": { + "nodeTopology": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"), }, }, "sentinel": { @@ -25313,7 +25347,7 @@ func schema_apimachinery_apis_autoscaling_v1alpha1_RedisSentinelComputeAutoscale }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec"}, + "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.ComputeAutoscalerSpec", "kubedb.dev/apimachinery/apis/autoscaling/v1alpha1.NodeTopology"}, } } diff --git a/apis/autoscaling/v1alpha1/perconaxtradb_types.go b/apis/autoscaling/v1alpha1/perconaxtradb_types.go index 23c603df0d..3ece3581d7 100644 --- a/apis/autoscaling/v1alpha1/perconaxtradb_types.go +++ b/apis/autoscaling/v1alpha1/perconaxtradb_types.go @@ -69,7 +69,7 @@ type PerconaXtraDBAutoscalerSpec struct { type PerconaXtraDBComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` PerconaXtraDB *ComputeAutoscalerSpec `json:"perconaxtradb,omitempty"` } diff --git a/apis/autoscaling/v1alpha1/postgres_types.go b/apis/autoscaling/v1alpha1/postgres_types.go index 3ec48f5e7e..6a84fa1182 100644 --- a/apis/autoscaling/v1alpha1/postgres_types.go +++ b/apis/autoscaling/v1alpha1/postgres_types.go @@ -71,7 +71,7 @@ type PostgresAutoscalerSpec struct { type PostgresComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` Postgres *ComputeAutoscalerSpec `json:"postgres,omitempty"` } diff --git a/apis/autoscaling/v1alpha1/proxysql_types.go b/apis/autoscaling/v1alpha1/proxysql_types.go index 8616d91263..c77e8be41c 100644 --- a/apis/autoscaling/v1alpha1/proxysql_types.go +++ b/apis/autoscaling/v1alpha1/proxysql_types.go @@ -70,7 +70,7 @@ type ProxySQLAutoscalerSpec struct { type ProxySQLComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` ProxySQL *ComputeAutoscalerSpec `json:"proxysql,omitempty"` } diff --git a/apis/autoscaling/v1alpha1/redis_sentinel_types.go b/apis/autoscaling/v1alpha1/redis_sentinel_types.go index 44a56a2170..cd8677b1e4 100644 --- a/apis/autoscaling/v1alpha1/redis_sentinel_types.go +++ b/apis/autoscaling/v1alpha1/redis_sentinel_types.go @@ -70,7 +70,7 @@ type RedisSentinelAutoscalerSpec struct { type RedisSentinelComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` Sentinel *ComputeAutoscalerSpec `json:"sentinel,omitempty"` } diff --git a/apis/autoscaling/v1alpha1/redis_types.go b/apis/autoscaling/v1alpha1/redis_types.go index 3d136f2fc9..21f33a45a2 100644 --- a/apis/autoscaling/v1alpha1/redis_types.go +++ b/apis/autoscaling/v1alpha1/redis_types.go @@ -71,7 +71,7 @@ type RedisAutoscalerSpec struct { type RedisComputeAutoscalerSpec struct { // +optional - NodeTopologyRef *core.LocalObjectReference `json:"nodeTopologyRef,omitempty"` + NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` Standalone *ComputeAutoscalerSpec `json:"standalone,omitempty"` Cluster *ComputeAutoscalerSpec `json:"cluster,omitempty"` diff --git a/apis/autoscaling/v1alpha1/type.go b/apis/autoscaling/v1alpha1/type.go index 4b811e226e..b83a597819 100644 --- a/apis/autoscaling/v1alpha1/type.go +++ b/apis/autoscaling/v1alpha1/type.go @@ -24,6 +24,21 @@ import ( kmapi "kmodules.xyz/client-go/api/v1" ) +type NodeTopology struct { + // Name of the NodeTopology object + Name string `json:"name,omitempty"` + // ScaleUpDiffPercentage describes in which difference (between recommended resource and the capacity of the nodePool) the opsReq should be triggered while scaling up + // Defaults to 15 + // +optional + // +kubebuilder:default=15 + ScaleUpDiffPercentage *int32 `json:"scaleUpDiffPercentage"` + // ScaleDownDiffPercentage describes in which difference (between recommended resource and the capacity of the nodePool) the opsReq should be triggered while scaling down + // Defaults to 25 + // +optional + // +kubebuilder:default=25 + ScaleDownDiffPercentage *int32 `json:"scaleDownDiffPercentage"` +} + // ContainerControlledValues controls which resource value should be autoscaled. // +kubebuilder:validation:Enum=RequestsAndLimits;RequestsOnly type ContainerControlledValues string diff --git a/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go b/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go index 7aabc0fe9d..601e2a8570 100644 --- a/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go +++ b/apis/autoscaling/v1alpha1/zz_generated.deepcopy.go @@ -305,10 +305,10 @@ func (in *ElasticsearchAutoscalerSpec) DeepCopy() *ElasticsearchAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ElasticsearchComputeAutoscalerSpec) DeepCopyInto(out *ElasticsearchComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.Node != nil { in, out := &in.Node, &out.Node @@ -775,10 +775,10 @@ func (in *MariaDBAutoscalerSpec) DeepCopy() *MariaDBAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MariaDBComputeAutoscalerSpec) DeepCopyInto(out *MariaDBComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.MariaDB != nil { in, out := &in.MariaDB, &out.MariaDB @@ -1113,10 +1113,10 @@ func (in *MongoDBAutoscalerSpec) DeepCopy() *MongoDBAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MongoDBComputeAutoscalerSpec) DeepCopyInto(out *MongoDBComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.Standalone != nil { in, out := &in.Standalone, &out.Standalone @@ -1333,10 +1333,10 @@ func (in *MySQLAutoscalerSpec) DeepCopy() *MySQLAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MySQLComputeAutoscalerSpec) DeepCopyInto(out *MySQLComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.MySQL != nil { in, out := &in.MySQL, &out.MySQL @@ -1403,6 +1403,32 @@ func (in *MySQLStorageAutoscalerSpec) DeepCopy() *MySQLStorageAutoscalerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeTopology) DeepCopyInto(out *NodeTopology) { + *out = *in + if in.ScaleUpDiffPercentage != nil { + in, out := &in.ScaleUpDiffPercentage, &out.ScaleUpDiffPercentage + *out = new(int32) + **out = **in + } + if in.ScaleDownDiffPercentage != nil { + in, out := &in.ScaleDownDiffPercentage, &out.ScaleDownDiffPercentage + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTopology. +func (in *NodeTopology) DeepCopy() *NodeTopology { + if in == nil { + return nil + } + out := new(NodeTopology) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PerconaXtraDBAutoscaler) DeepCopyInto(out *PerconaXtraDBAutoscaler) { *out = *in @@ -1503,10 +1529,10 @@ func (in *PerconaXtraDBAutoscalerSpec) DeepCopy() *PerconaXtraDBAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PerconaXtraDBComputeAutoscalerSpec) DeepCopyInto(out *PerconaXtraDBComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.PerconaXtraDB != nil { in, out := &in.PerconaXtraDB, &out.PerconaXtraDB @@ -1890,10 +1916,10 @@ func (in *PostgresAutoscalerSpec) DeepCopy() *PostgresAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresComputeAutoscalerSpec) DeepCopyInto(out *PostgresComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.Postgres != nil { in, out := &in.Postgres, &out.Postgres @@ -2050,10 +2076,10 @@ func (in *ProxySQLAutoscalerSpec) DeepCopy() *ProxySQLAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxySQLComputeAutoscalerSpec) DeepCopyInto(out *ProxySQLComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.ProxySQL != nil { in, out := &in.ProxySQL, &out.ProxySQL @@ -2261,10 +2287,10 @@ func (in *RedisAutoscalerSpec) DeepCopy() *RedisAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisComputeAutoscalerSpec) DeepCopyInto(out *RedisComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.Standalone != nil { in, out := &in.Standalone, &out.Standalone @@ -2410,10 +2436,10 @@ func (in *RedisSentinelAutoscalerSpec) DeepCopy() *RedisSentinelAutoscalerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisSentinelComputeAutoscalerSpec) DeepCopyInto(out *RedisSentinelComputeAutoscalerSpec) { *out = *in - if in.NodeTopologyRef != nil { - in, out := &in.NodeTopologyRef, &out.NodeTopologyRef - *out = new(corev1.LocalObjectReference) - **out = **in + if in.NodeTopology != nil { + in, out := &in.NodeTopology, &out.NodeTopology + *out = new(NodeTopology) + (*in).DeepCopyInto(*out) } if in.Sentinel != nil { in, out := &in.Sentinel, &out.Sentinel diff --git a/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml b/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml index 0d89031a6c..f010e67589 100644 --- a/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_elasticsearchautoscalers.yaml @@ -518,12 +518,19 @@ spec: trigger: type: string type: object - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic transform: properties: containerControlledValues: diff --git a/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml b/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml index 3f4b2db4aa..43dc798cef 100644 --- a/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_mariadbautoscalers.yaml @@ -78,12 +78,19 @@ spec: trigger: type: string type: object - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic type: object databaseRef: properties: diff --git a/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml b/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml index 72086b7e3d..dbe44cc525 100644 --- a/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_mongodbautoscalers.yaml @@ -210,12 +210,19 @@ spec: trigger: type: string type: object - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic replicaSet: properties: containerControlledValues: diff --git a/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml b/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml index e2910410fb..f644467e76 100644 --- a/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_mysqlautoscalers.yaml @@ -78,12 +78,19 @@ spec: trigger: type: string type: object - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic type: object databaseRef: properties: diff --git a/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml b/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml index ad28e2be62..9a0d11b572 100644 --- a/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_perconaxtradbautoscalers.yaml @@ -34,12 +34,19 @@ spec: properties: compute: properties: - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic perconaxtradb: properties: containerControlledValues: diff --git a/crds/autoscaling.kubedb.com_postgresautoscalers.yaml b/crds/autoscaling.kubedb.com_postgresautoscalers.yaml index 93aba272a6..f1fe5f0b3f 100644 --- a/crds/autoscaling.kubedb.com_postgresautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_postgresautoscalers.yaml @@ -34,12 +34,19 @@ spec: properties: compute: properties: - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic postgres: properties: containerControlledValues: diff --git a/crds/autoscaling.kubedb.com_proxysqlautoscalers.yaml b/crds/autoscaling.kubedb.com_proxysqlautoscalers.yaml index 304158ee63..207bf1efcf 100644 --- a/crds/autoscaling.kubedb.com_proxysqlautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_proxysqlautoscalers.yaml @@ -34,12 +34,19 @@ spec: properties: compute: properties: - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic proxysql: properties: containerControlledValues: diff --git a/crds/autoscaling.kubedb.com_redisautoscalers.yaml b/crds/autoscaling.kubedb.com_redisautoscalers.yaml index 0d0852e097..e0ee6df49f 100644 --- a/crds/autoscaling.kubedb.com_redisautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_redisautoscalers.yaml @@ -78,12 +78,19 @@ spec: trigger: type: string type: object - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic sentinel: properties: containerControlledValues: diff --git a/crds/autoscaling.kubedb.com_redissentinelautoscalers.yaml b/crds/autoscaling.kubedb.com_redissentinelautoscalers.yaml index 78c9763faa..e255419378 100644 --- a/crds/autoscaling.kubedb.com_redissentinelautoscalers.yaml +++ b/crds/autoscaling.kubedb.com_redissentinelautoscalers.yaml @@ -34,12 +34,19 @@ spec: properties: compute: properties: - nodeTopologyRef: + nodeTopology: properties: name: type: string + scaleDownDiffPercentage: + default: 25 + format: int32 + type: integer + scaleUpDiffPercentage: + default: 15 + format: int32 + type: integer type: object - x-kubernetes-map-type: atomic sentinel: properties: containerControlledValues: diff --git a/go.mod b/go.mod index 7bc3369cb0..258a12381d 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( kmodules.xyz/monitoring-agent-api v0.25.6 kmodules.xyz/objectstore-api v0.25.1 kmodules.xyz/offshoot-api v0.25.5 - kmodules.xyz/resource-metadata v0.17.42 + kmodules.xyz/resource-metadata v0.17.44 kmodules.xyz/webhook-runtime v0.25.0 kubeops.dev/sidekick v0.0.4 kubestash.dev/apimachinery v0.2.0 diff --git a/go.sum b/go.sum index 50466c2ef5..e3ee7b9e7f 100644 --- a/go.sum +++ b/go.sum @@ -1466,8 +1466,8 @@ kmodules.xyz/offshoot-api v0.25.5 h1:erUtTDj9iljikd9CvrCz0E32P5mgEqq1NYxy06lxrNo kmodules.xyz/offshoot-api v0.25.5/go.mod h1:wotLtcXWHw6KrWX6Ry2EsHn2I2QTvyLX7gXAuwBjkFc= kmodules.xyz/prober v0.25.0 h1:R5uRLHJEvEtEoogj+vaTAob0Btph6+PX5IlS6hPh8PA= kmodules.xyz/prober v0.25.0/go.mod h1:z4RTnjaajNQa/vPltsiOnO3xI716I/ziD2ac2Exm+1M= -kmodules.xyz/resource-metadata v0.17.42 h1:JEJIR/gBFpO6lLc3oMYv4nkOe7odoJWLpM8+Tar1CXA= -kmodules.xyz/resource-metadata v0.17.42/go.mod h1:a8MUmKJVYBjlwaEM0wP5z/6KQRGoktSQQ52utvDhpJg= +kmodules.xyz/resource-metadata v0.17.44 h1:BbsvZxoRZWAgjkHF+VGeO5mo2Lc1BekAvmpiuasdECM= +kmodules.xyz/resource-metadata v0.17.44/go.mod h1:a8MUmKJVYBjlwaEM0wP5z/6KQRGoktSQQ52utvDhpJg= kmodules.xyz/resource-metrics v0.25.7 h1:ne2cK/dlnfYcuu0+pHX15Y53rcKBQq9DuCtQVcx6rY8= kmodules.xyz/resource-metrics v0.25.7/go.mod h1:y7pDmTWuVLNGSjwckKCwJFhCgi5fhbwS7PAcH2rmGcY= kmodules.xyz/webhook-runtime v0.25.0 h1:NKNgu0C1I8kUovQ+SVozs/q7cjq8zgpSjLfJf9CxUtk= diff --git a/vendor/kmodules.xyz/resource-metadata/apis/management/doc.go b/vendor/kmodules.xyz/resource-metadata/apis/node/doc.go similarity index 90% rename from vendor/kmodules.xyz/resource-metadata/apis/management/doc.go rename to vendor/kmodules.xyz/resource-metadata/apis/node/doc.go index ac5ecce2a6..c73530dc9d 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/management/doc.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/node/doc.go @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -package management +package node const ( - GroupName = "management.k8s.appscode.com" + GroupName = "node.k8s.appscode.com" ) diff --git a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/nodetopology_types.go b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/nodetopology_types.go index d993ae9560..81a06e22f4 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/nodetopology_types.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/nodetopology_types.go @@ -52,9 +52,9 @@ type NodeTopologySpec struct { type NodeGroup struct { TopologyValue string `json:"topologyValue"` - // Capacity represents the total resources of a node. + // Allocatable represents the total resources of a node. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity - Capacity core.ResourceList `json:"capacity"` + Allocatable core.ResourceList `json:"allocatable"` } // +kubebuilder:validation:Enum=LabelSelector;Taint diff --git a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go index dba551a226..03602d21a1 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go @@ -14600,9 +14600,9 @@ func schema_resource_metadata_apis_node_v1alpha1_NodeGroup(ref common.ReferenceC Format: "", }, }, - "capacity": { + "allocatable": { SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", + Description: "Allocatable represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -14616,7 +14616,7 @@ func schema_resource_metadata_apis_node_v1alpha1_NodeGroup(ref common.ReferenceC }, }, }, - Required: []string{"topologyValue", "capacity"}, + Required: []string{"topologyValue", "allocatable"}, }, }, Dependencies: []string{ diff --git a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/register.go b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/register.go index 825e0f5cae..99334b8213 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/register.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/register.go @@ -17,14 +17,14 @@ limitations under the License. package v1alpha1 import ( - "kmodules.xyz/resource-metadata/apis/management" + "kmodules.xyz/resource-metadata/apis/node" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) -var SchemeGroupVersion = schema.GroupVersion{Group: management.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: node.GroupName, Version: "v1alpha1"} var ( // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. diff --git a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/zz_generated.deepcopy.go b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/zz_generated.deepcopy.go index 1c961e3dce..6456a26af1 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/zz_generated.deepcopy.go @@ -29,8 +29,8 @@ import ( // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeGroup) DeepCopyInto(out *NodeGroup) { *out = *in - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity + if in.Allocatable != nil { + in, out := &in.Allocatable, &out.Allocatable *out = make(v1.ResourceList, len(*in)) for key, val := range *in { (*out)[key] = val.DeepCopy() diff --git a/vendor/kmodules.xyz/resource-metadata/crds/node.k8s.appscode.com_nodetopologies.yaml b/vendor/kmodules.xyz/resource-metadata/crds/node.k8s.appscode.com_nodetopologies.yaml index 48bdc94c92..d6ef9809d0 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/node.k8s.appscode.com_nodetopologies.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/node.k8s.appscode.com_nodetopologies.yaml @@ -42,20 +42,20 @@ spec: nodeGroups: items: properties: - capacity: + allocatable: additionalProperties: 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 - description: 'Capacity represents the total resources of a node. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity' + description: 'Allocatable represents the total resources of + a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity' type: object topologyValue: type: string required: - - capacity + - allocatable - topologyValue type: object type: array diff --git a/vendor/modules.txt b/vendor/modules.txt index f4b921a570..9e8d761577 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1517,10 +1517,10 @@ kmodules.xyz/offshoot-api/api/v1 # kmodules.xyz/prober v0.25.0 ## explicit; go 1.18 kmodules.xyz/prober/api/v1 -# kmodules.xyz/resource-metadata v0.17.42 +# kmodules.xyz/resource-metadata v0.17.44 ## explicit; go 1.18 kmodules.xyz/resource-metadata/apis/core/v1alpha1 -kmodules.xyz/resource-metadata/apis/management +kmodules.xyz/resource-metadata/apis/node kmodules.xyz/resource-metadata/apis/node/v1alpha1 kmodules.xyz/resource-metadata/apis/shared kmodules.xyz/resource-metadata/crds