-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: sayedppqq <[email protected]>
- Loading branch information
Showing
64 changed files
with
16,141 additions
and
716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
vendor/kubedb.dev/apimachinery/apis/autoscaling/v1alpha1/cassandra_helpers.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 (r CassandraAutoscaler) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { | ||
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralCassandraAutoscaler)) | ||
} | ||
|
||
var _ apis.ResourceInfo = &CassandraAutoscaler{} | ||
|
||
func (r CassandraAutoscaler) ResourceFQN() string { | ||
return fmt.Sprintf("%s.%s", ResourcePluralCassandraAutoscaler, autoscaling.GroupName) | ||
} | ||
|
||
func (r CassandraAutoscaler) ResourceShortCode() string { | ||
return ResourceCodeCassandraAutoscaler | ||
} | ||
|
||
func (r CassandraAutoscaler) ResourceKind() string { | ||
return ResourceKindCassandraAutoscaler | ||
} | ||
|
||
func (r CassandraAutoscaler) ResourceSingular() string { | ||
return ResourceSingularCassandraAutoscaler | ||
} | ||
|
||
func (r CassandraAutoscaler) ResourcePlural() string { | ||
return ResourcePluralCassandraAutoscaler | ||
} | ||
|
||
func (r CassandraAutoscaler) ValidateSpecs() error { | ||
return nil | ||
} | ||
|
||
var _ StatusAccessor = &CassandraAutoscaler{} | ||
|
||
func (r *CassandraAutoscaler) GetStatus() AutoscalerStatus { | ||
return r.Status | ||
} | ||
|
||
func (r *CassandraAutoscaler) SetStatus(s AutoscalerStatus) { | ||
r.Status = s | ||
} |
100 changes: 100 additions & 0 deletions
100
vendor/kubedb.dev/apimachinery/apis/autoscaling/v1alpha1/cassandra_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
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 ( | ||
opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" | ||
|
||
core "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
ResourceCodeCassandraAutoscaler = "casscaler" | ||
ResourceKindCassandraAutoscaler = "CassandraAutoscaler" | ||
ResourceSingularCassandraAutoscaler = "cassandraautoscaler" | ||
ResourcePluralCassandraAutoscaler = "cassandraautoscalers" | ||
) | ||
|
||
// CassandraAutoscaler is the configuration for a cassandra 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=cassandraautoscalers,singular=cassandraautoscaler,shortName=casscaler,categories={autoscaler,kubedb,appscode} | ||
// +kubebuilder:subresource:status | ||
type CassandraAutoscaler 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 CassandraAutoscalerSpec `json:"spec"` | ||
|
||
// Current information about the autoscaler. | ||
// +optional | ||
Status AutoscalerStatus `json:"status,omitempty"` | ||
} | ||
|
||
// CassandraAutoscalerSpec is the specification of the behavior of the autoscaler. | ||
type CassandraAutoscalerSpec struct { | ||
DatabaseRef *core.LocalObjectReference `json:"databaseRef"` | ||
|
||
// This field will be used to control the behaviour of ops-manager | ||
OpsRequestOptions *CassandraOpsRequestOptions `json:"opsRequestOptions,omitempty"` | ||
|
||
Compute *CassandraComputeAutoscalerSpec `json:"compute,omitempty"` | ||
Storage *CassandraStorageAutoscalerSpec `json:"storage,omitempty"` | ||
} | ||
|
||
type CassandraComputeAutoscalerSpec struct { | ||
// +optional | ||
NodeTopology *NodeTopology `json:"nodeTopology,omitempty"` | ||
|
||
Cassandra *ComputeAutoscalerSpec `json:"cassandra,omitempty"` | ||
} | ||
|
||
type CassandraStorageAutoscalerSpec struct { | ||
Cassandra *StorageAutoscalerSpec `json:"cassandra,omitempty"` | ||
} | ||
|
||
type CassandraOpsRequestOptions struct { | ||
// Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure. | ||
Timeout *metav1.Duration `json:"timeout,omitempty"` | ||
|
||
// ApplyOption is to control the execution of OpsRequest depending on the database state. | ||
// +kubebuilder:default="IfReady" | ||
Apply opsapi.ApplyOption `json:"apply,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
// CassandraAutoscalerList is a list of CassandraAutoscaler objects. | ||
type CassandraAutoscalerList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// metadata is the standard list metadata. | ||
// +optional | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
// items is the list of cassandra database autoscaler objects. | ||
Items []CassandraAutoscaler `json:"items"` | ||
} |
Oops, something went wrong.