Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ require (
kmodules.xyz/client-go v0.34.3
kmodules.xyz/custom-resources v0.34.0
kmodules.xyz/monitoring-agent-api v0.34.1
kubedb.dev/apimachinery v0.65.0-rc.2
kubedb.dev/db-client-go v0.20.0-rc.2
kubedb.dev/apimachinery v0.65.0
kubedb.dev/db-client-go v0.20.0
kubeops.dev/petset v0.0.17-0.20260418091244-7f666912d240
sigs.k8s.io/controller-runtime v0.22.4
sigs.k8s.io/yaml v1.6.0
Expand Down Expand Up @@ -189,7 +189,7 @@ require (
kubeops.dev/csi-driver-cacerts v0.5.1-0.20260418091014-4f539f46235c // indirect
kubeops.dev/operator-shard-manager v0.0.6-0.20260418091213-65daf7da824d // indirect
kubeops.dev/sidekick v0.0.15-0.20260418091208-a1cb9f4a3553 // indirect
kubestash.dev/apimachinery v0.28.0-rc.2 // indirect
kubestash.dev/apimachinery v0.28.0 // indirect
open-cluster-management.io/api v1.2.0 // indirect
sigs.k8s.io/cli-utils v0.37.2 // indirect
sigs.k8s.io/gateway-api v1.4.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,10 @@ kmodules.xyz/resource-metadata v0.46.1 h1:mm4sWZvQMFJJiLdKlPGxD9Cj6f44SCdHB7Csbk
kmodules.xyz/resource-metadata v0.46.1/go.mod h1:ejz7IVjhqmj6VH8CVfprocJK/IM++OeunrfUp51ZrIw=
kmodules.xyz/resource-metrics v0.34.0 h1:cqscgTx3PONxHj6PIySK3sTlKKv8iKTGzRd+S6YSwXg=
kmodules.xyz/resource-metrics v0.34.0/go.mod h1:R34IKtp5+NqcQz7AQJheBJK6Iem0LqrCbm/55Mn+ECQ=
kubedb.dev/apimachinery v0.65.0-rc.2 h1:eLVxPxtf9DKtJQqWxSFwiItjDnllJUZy6VAFrNQAkGE=
kubedb.dev/apimachinery v0.65.0-rc.2/go.mod h1:sfWGbWkFnv3bJhG1gfVMSbcRpU1OS2Sb+pO1RZSCBXg=
kubedb.dev/db-client-go v0.20.0-rc.2 h1:yQtzBvpjygM3BPqAXeqkkYJCSgfuFcNa+EoPaAkRZo8=
kubedb.dev/db-client-go v0.20.0-rc.2/go.mod h1:auOttJS4GV/PmFG35ptMtT96ocy+4yTwAqTfrGJ2aSc=
kubedb.dev/apimachinery v0.65.0 h1:fAgu/jR+QImZhpSe1sTc6jISQ1LYETzrX8q85DuZ9GA=
kubedb.dev/apimachinery v0.65.0/go.mod h1:TWiZCxq/9q0TN8+OjMS5pvhsLYPvtvb2aASZUPwETzA=
kubedb.dev/db-client-go v0.20.0 h1:HmDLWUBOZwt1m40bls4yL8DuwegEhzHp4NG2k9IpPDk=
kubedb.dev/db-client-go v0.20.0/go.mod h1:QTWcre0Q5OVa53t+HT1uTNeRRRIYlzCFKi6nUXjArjk=
kubeops.dev/csi-driver-cacerts v0.5.1-0.20260418091014-4f539f46235c h1:ZKmBV3fFfCWQ3jDeWBbUi2J4WjJ2ff88n+cTqJ8ZXT8=
kubeops.dev/csi-driver-cacerts v0.5.1-0.20260418091014-4f539f46235c/go.mod h1:VNbwC3gTWfmdQCVxd8mkVx+n1+0F1lOA5X3usyZN1rk=
kubeops.dev/operator-shard-manager v0.0.6-0.20260418091213-65daf7da824d h1:/nZYflp2w1x+wQmxDtHR0Sbzl39fcuaJ66oqgVXBBwQ=
Expand All @@ -805,8 +805,8 @@ kubeops.dev/petset v0.0.17-0.20260418091244-7f666912d240 h1:6FyI0dCC/1aaJqdCqEty
kubeops.dev/petset v0.0.17-0.20260418091244-7f666912d240/go.mod h1:zb++ZwjAon+cueexxhRSSxzJnNX1J/scqvDrGgeRHcQ=
kubeops.dev/sidekick v0.0.15-0.20260418091208-a1cb9f4a3553 h1:metVCjSnZJmPcON1wUuedyve0lV8IPNXxuGt6FgDMi4=
kubeops.dev/sidekick v0.0.15-0.20260418091208-a1cb9f4a3553/go.mod h1:JelNzrL+K2S3BvkxDi2bE9lxaP5Y+HeDQooXIlKBorM=
kubestash.dev/apimachinery v0.28.0-rc.2 h1:58l08lH9Hfomaq5uVXF71OP5R4rtyiz/uP8x9ndfioo=
kubestash.dev/apimachinery v0.28.0-rc.2/go.mod h1:zzvfyJ0ACaxAzk1to1cERIrIacHACASWcPbDkel9lyE=
kubestash.dev/apimachinery v0.28.0 h1:0JwpV9AA4VcfxyoUTfrvJDcXAWBUg/CXCcdAGMx6IYI=
kubestash.dev/apimachinery v0.28.0/go.mod h1:zzvfyJ0ACaxAzk1to1cERIrIacHACASWcPbDkel9lyE=
open-cluster-management.io/api v1.2.0 h1:+yeQgJiErrur5S4s205UM37EcZ2XbC9pFSm0xgV5/hU=
open-cluster-management.io/api v1.2.0/go.mod h1:YcmA6SpGEekIMxdoeVIIyOaBhMA6ImWRLXP4g8n8T+4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
"fmt"

"kubedb.dev/apimachinery/apis"
"kubedb.dev/apimachinery/apis/autoscaling"
"kubedb.dev/apimachinery/crds"

"kmodules.xyz/client-go/apiextensions"
)

func (AerospikeAutoscaler) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralAerospikeAutoscaler))
}

var _ apis.ResourceInfo = &AerospikeAutoscaler{}

func (a AerospikeAutoscaler) ResourceFQN() string {
return fmt.Sprintf("%s.%s", ResourcePluralAerospikeAutoscaler, autoscaling.GroupName)
}

func (a AerospikeAutoscaler) ResourceShortCode() string {
return ResourceCodeAerospikeAutoscaler
}

func (a AerospikeAutoscaler) ResourceKind() string {
return ResourceKindAerospikeAutoscaler
}

func (a AerospikeAutoscaler) ResourceSingular() string {
return ResourceSingularAerospikeAutoscaler
}

func (a AerospikeAutoscaler) ResourcePlural() string {
return ResourcePluralAerospikeAutoscaler
}

func (a AerospikeAutoscaler) ValidateSpecs() error {
return nil
}

var _ StatusAccessor = &AerospikeAutoscaler{}

func (a *AerospikeAutoscaler) GetStatus() AutoscalerStatus {
return a.Status
}

func (a *AerospikeAutoscaler) SetStatus(s AutoscalerStatus) {
a.Status = s
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceCodeAerospikeAutoscaler = "asscaler"
ResourceKindAerospikeAutoscaler = "AerospikeAutoscaler"
ResourceSingularAerospikeAutoscaler = "aerospikeautoscaler"
ResourcePluralAerospikeAutoscaler = "aerospikeautoscalers"
)

// AerospikeAutoscaler is the configuration for an Aerospike database
// autoscaler, which automatically manages pod resources based on historical and
// real time resource utilization.

// +genclient
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=aerospikeautoscalers,singular=aerospikeautoscaler,shortName=asscaler,categories={autoscaler,kubedb,appscode}
// +kubebuilder:subresource:status
type AerospikeAutoscaler struct {
metav1.TypeMeta `json:",inline"`
// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

// Specification of the behavior of the autoscaler.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
Spec AerospikeAutoscalerSpec `json:"spec"`

// Current information about the autoscaler.
// +optional
Status AutoscalerStatus `json:"status,omitempty"`
}

// AerospikeAutoscalerSpec is the specification of the behavior of the autoscaler.
type AerospikeAutoscalerSpec struct {
DatabaseRef *core.LocalObjectReference `json:"databaseRef"`

// OpsRequestOptions will be used to control the behaviour of ops-manager
OpsRequestOptions *OpsRequestOptions `json:"opsRequestOptions,omitempty"`

Compute *AerospikeComputeAutoscalerSpec `json:"compute,omitempty"`
}

type AerospikeComputeAutoscalerSpec struct {
// +optional
NodeTopology *NodeTopology `json:"nodeTopology,omitempty"`

Aerospike *ComputeAutoscalerSpec `json:"aerospike,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AerospikeAutoscalerList is a list of AerospikeAutoscaler objects.
type AerospikeAutoscalerList struct {
metav1.TypeMeta `json:",inline"`
// metadata is the standard list metadata.
// +optional
metav1.ListMeta `json:"metadata"`

// items is the list of Aerospike database autoscaler objects.
Items []AerospikeAutoscaler `json:"items"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
"fmt"

"kubedb.dev/apimachinery/apis"
"kubedb.dev/apimachinery/apis/autoscaling"
"kubedb.dev/apimachinery/crds"

"kmodules.xyz/client-go/apiextensions"
)

func (DB2Autoscaler) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralDB2Autoscaler))
}

var _ apis.ResourceInfo = &DB2Autoscaler{}

func (d DB2Autoscaler) ResourceFQN() string {
return fmt.Sprintf("%s.%s", ResourcePluralDB2Autoscaler, autoscaling.GroupName)
}

func (d DB2Autoscaler) ResourceShortCode() string {
return ResourceCodeDB2Autoscaler
}

func (d DB2Autoscaler) ResourceKind() string {
return ResourceKindDB2Autoscaler
}

func (d DB2Autoscaler) ResourceSingular() string {
return ResourceSingularDB2Autoscaler
}

func (d DB2Autoscaler) ResourcePlural() string {
return ResourcePluralDB2Autoscaler
}

func (d DB2Autoscaler) ValidateSpecs() error {
return nil
}

var _ StatusAccessor = &DB2Autoscaler{}

func (d *DB2Autoscaler) GetStatus() AutoscalerStatus {
return d.Status
}

func (d *DB2Autoscaler) SetStatus(s AutoscalerStatus) {
d.Status = s
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceCodeDB2Autoscaler = "db2scaler"
ResourceKindDB2Autoscaler = "DB2Autoscaler"
ResourceSingularDB2Autoscaler = "db2autoscaler"
ResourcePluralDB2Autoscaler = "db2autoscalers"
)

// DB2Autoscaler is the configuration for a DB2 database
// autoscaler, which automatically manages pod resources based on historical and
// real time resource utilization.

// +genclient
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=db2autoscalers,singular=db2autoscaler,shortName=db2scaler,categories={autoscaler,kubedb,appscode}
// +kubebuilder:subresource:status
type DB2Autoscaler struct {
metav1.TypeMeta `json:",inline"`
// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

// Specification of the behavior of the autoscaler.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
Spec DB2AutoscalerSpec `json:"spec"`

// Current information about the autoscaler.
// +optional
Status AutoscalerStatus `json:"status,omitempty"`
}

// DB2AutoscalerSpec is the specification of the behavior of the autoscaler.
type DB2AutoscalerSpec struct {
DatabaseRef *core.LocalObjectReference `json:"databaseRef"`

// OpsRequestOptions will be used to control the behaviour of ops-manager
OpsRequestOptions *OpsRequestOptions `json:"opsRequestOptions,omitempty"`

Compute *DB2ComputeAutoscalerSpec `json:"compute,omitempty"`
}

type DB2ComputeAutoscalerSpec struct {
// +optional
NodeTopology *NodeTopology `json:"nodeTopology,omitempty"`

DB2 *ComputeAutoscalerSpec `json:"db2,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// DB2AutoscalerList is a list of DB2Autoscaler objects.
type DB2AutoscalerList struct {
metav1.TypeMeta `json:",inline"`
// metadata is the standard list metadata.
// +optional
metav1.ListMeta `json:"metadata"`

// items is the list of DB2 database autoscaler objects.
Items []DB2Autoscaler `json:"items"`
}
Loading
Loading