/
autoscalingstrategy_types.go
59 lines (48 loc) · 1.9 KB
/
autoscalingstrategy_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Copyright (c) Edgeless Systems GmbH
SPDX-License-Identifier: AGPL-3.0-only
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// AutoscalingStrategySpec defines the desired state of AutoscalingStrategy.
type AutoscalingStrategySpec struct {
// Enabled defines whether cluster autoscaling should be enabled or not.
Enabled bool `json:"enabled"`
// DeploymentName defines the name of the autoscaler deployment.
DeploymentName string `json:"deploymentName"`
// DeploymentNamespace defines the namespace of the autoscaler deployment.
DeploymentNamespace string `json:"deploymentNamespace"`
// AutoscalerExtraArgs defines extra arguments to be passed to the autoscaler.
AutoscalerExtraArgs map[string]string `json:"autoscalerExtraArgs,omitempty"`
}
// AutoscalingStrategyStatus defines the observed state of AutoscalingStrategy.
type AutoscalingStrategyStatus struct {
// Enabled shows whether cluster autoscaling is currently enabled or not.
// +optional
Enabled bool `json:"enabled,omitempty"`
// Replicas is the number of replicas for the autoscaler deployment.
// +optional
Replicas int32 `json:"replicas,omitempty"`
}
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
// AutoscalingStrategy is the Schema for the autoscalingstrategies API.
type AutoscalingStrategy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AutoscalingStrategySpec `json:"spec,omitempty"`
Status AutoscalingStrategyStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// AutoscalingStrategyList contains a list of AutoscalingStrategy.
type AutoscalingStrategyList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AutoscalingStrategy `json:"items"`
}
func init() {
SchemeBuilder.Register(&AutoscalingStrategy{}, &AutoscalingStrategyList{})
}