-
Notifications
You must be signed in to change notification settings - Fork 61
/
zz_autoscalingpolicy_types.go
executable file
·236 lines (191 loc) · 10.8 KB
/
zz_autoscalingpolicy_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
Copyright 2021 The Crossplane Authors.
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.
*/
// Code generated by upjet. DO NOT EDIT.
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
v1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)
type AutoscalingPolicyObservation struct {
// an identifier for the resource with format projects/{{project}}/locations/{{location}}/autoscalingPolicies/{{policy_id}}
ID *string `json:"id,omitempty" tf:"id,omitempty"`
// The "resource name" of the autoscaling policy.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
}
type AutoscalingPolicyParameters struct {
// Basic algorithm for autoscaling.
// Structure is documented below.
// +kubebuilder:validation:Optional
BasicAlgorithm []BasicAlgorithmParameters `json:"basicAlgorithm,omitempty" tf:"basic_algorithm,omitempty"`
// The location where the autoscaling policy should reside.
// The default value is global.
// +kubebuilder:validation:Optional
Location *string `json:"location,omitempty" tf:"location,omitempty"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
// +kubebuilder:validation:Optional
Project *string `json:"project,omitempty" tf:"project,omitempty"`
// Describes how the autoscaler will operate for secondary workers.
// Structure is documented below.
// +kubebuilder:validation:Optional
SecondaryWorkerConfig []SecondaryWorkerConfigParameters `json:"secondaryWorkerConfig,omitempty" tf:"secondary_worker_config,omitempty"`
// Describes how the autoscaler will operate for primary workers.
// Structure is documented below.
// +kubebuilder:validation:Optional
WorkerConfig []WorkerConfigParameters `json:"workerConfig,omitempty" tf:"worker_config,omitempty"`
}
type BasicAlgorithmObservation struct {
}
type BasicAlgorithmParameters struct {
// Duration between scaling events. A scaling period starts after the
// update operation from the previous event has completed.
// Bounds: [2m, 1d]. Default: 2m.
// +kubebuilder:validation:Optional
CooldownPeriod *string `json:"cooldownPeriod,omitempty" tf:"cooldown_period,omitempty"`
// YARN autoscaling configuration.
// Structure is documented below.
// +kubebuilder:validation:Required
YarnConfig []YarnConfigParameters `json:"yarnConfig" tf:"yarn_config,omitempty"`
}
type SecondaryWorkerConfigObservation struct {
}
type SecondaryWorkerConfigParameters struct {
// Maximum number of instances for this group. Note that by default, clusters will not use
// secondary workers. Required for secondary workers if the minimum secondary instances is set.
// Bounds: [minInstances, ). Defaults to 0.
// +kubebuilder:validation:Optional
MaxInstances *float64 `json:"maxInstances,omitempty" tf:"max_instances,omitempty"`
// Minimum number of instances for this group. Bounds: [0, maxInstances]. Defaults to 0.
// +kubebuilder:validation:Optional
MinInstances *float64 `json:"minInstances,omitempty" tf:"min_instances,omitempty"`
// Weight for the instance group, which is used to determine the fraction of total workers
// in the cluster from this instance group. For example, if primary workers have weight 2,
// and secondary workers have weight 1, the cluster will have approximately 2 primary workers
// for each secondary worker.
// The cluster may not reach the specified balance if constrained by min/max bounds or other
// autoscaling settings. For example, if maxInstances for secondary workers is 0, then only
// primary workers will be added. The cluster can also be out of balance when created.
// If weight is not set on any instance group, the cluster will default to equal weight for
// all groups: the cluster will attempt to maintain an equal number of workers in each group
// within the configured size bounds for each group. If weight is set for one group only,
// the cluster will default to zero weight on the unset group. For example if weight is set
// only on primary workers, the cluster will use primary workers only and no secondary workers.
// +kubebuilder:validation:Optional
Weight *float64 `json:"weight,omitempty" tf:"weight,omitempty"`
}
type WorkerConfigObservation struct {
}
type WorkerConfigParameters struct {
// Maximum number of instances for this group.
// +kubebuilder:validation:Required
MaxInstances *float64 `json:"maxInstances" tf:"max_instances,omitempty"`
// Minimum number of instances for this group. Bounds: [2, maxInstances]. Defaults to 2.
// +kubebuilder:validation:Optional
MinInstances *float64 `json:"minInstances,omitempty" tf:"min_instances,omitempty"`
// Weight for the instance group, which is used to determine the fraction of total workers
// in the cluster from this instance group. For example, if primary workers have weight 2,
// and secondary workers have weight 1, the cluster will have approximately 2 primary workers
// for each secondary worker.
// The cluster may not reach the specified balance if constrained by min/max bounds or other
// autoscaling settings. For example, if maxInstances for secondary workers is 0, then only
// primary workers will be added. The cluster can also be out of balance when created.
// If weight is not set on any instance group, the cluster will default to equal weight for
// all groups: the cluster will attempt to maintain an equal number of workers in each group
// within the configured size bounds for each group. If weight is set for one group only,
// the cluster will default to zero weight on the unset group. For example if weight is set
// only on primary workers, the cluster will use primary workers only and no secondary workers.
// +kubebuilder:validation:Optional
Weight *float64 `json:"weight,omitempty" tf:"weight,omitempty"`
}
type YarnConfigObservation struct {
}
type YarnConfigParameters struct {
// Timeout for YARN graceful decommissioning of Node Managers. Specifies the
// duration to wait for jobs to complete before forcefully removing workers
// (and potentially interrupting jobs). Only applicable to downscaling operations.
// Bounds: [0s, 1d].
// +kubebuilder:validation:Required
GracefulDecommissionTimeout *string `json:"gracefulDecommissionTimeout" tf:"graceful_decommission_timeout,omitempty"`
// Fraction of average pending memory in the last cooldown period for which to
// remove workers. A scale-down factor of 1 will result in scaling down so that there
// is no available memory remaining after the update (more aggressive scaling).
// A scale-down factor of 0 disables removing workers, which can be beneficial for
// autoscaling a single job.
// Bounds: [0.0, 1.0].
// +kubebuilder:validation:Required
ScaleDownFactor *float64 `json:"scaleDownFactor" tf:"scale_down_factor,omitempty"`
// Minimum scale-down threshold as a fraction of total cluster size before scaling occurs.
// For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must
// recommend at least a 2 worker scale-down for the cluster to scale. A threshold of 0
// means the autoscaler will scale down on any recommended change.
// Bounds: [0.0, 1.0]. Default: 0.0.
// +kubebuilder:validation:Optional
ScaleDownMinWorkerFraction *float64 `json:"scaleDownMinWorkerFraction,omitempty" tf:"scale_down_min_worker_fraction,omitempty"`
// Fraction of average pending memory in the last cooldown period for which to
// add workers. A scale-up factor of 1.0 will result in scaling up so that there
// is no pending memory remaining after the update (more aggressive scaling).
// A scale-up factor closer to 0 will result in a smaller magnitude of scaling up
// (less aggressive scaling).
// Bounds: [0.0, 1.0].
// +kubebuilder:validation:Required
ScaleUpFactor *float64 `json:"scaleUpFactor" tf:"scale_up_factor,omitempty"`
// Minimum scale-up threshold as a fraction of total cluster size before scaling
// occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler
// must recommend at least a 2-worker scale-up for the cluster to scale. A threshold of
// 0 means the autoscaler will scale up on any recommended change.
// Bounds: [0.0, 1.0]. Default: 0.0.
// +kubebuilder:validation:Optional
ScaleUpMinWorkerFraction *float64 `json:"scaleUpMinWorkerFraction,omitempty" tf:"scale_up_min_worker_fraction,omitempty"`
}
// AutoscalingPolicySpec defines the desired state of AutoscalingPolicy
type AutoscalingPolicySpec struct {
v1.ResourceSpec `json:",inline"`
ForProvider AutoscalingPolicyParameters `json:"forProvider"`
}
// AutoscalingPolicyStatus defines the observed state of AutoscalingPolicy.
type AutoscalingPolicyStatus struct {
v1.ResourceStatus `json:",inline"`
AtProvider AutoscalingPolicyObservation `json:"atProvider,omitempty"`
}
// +kubebuilder:object:root=true
// AutoscalingPolicy is the Schema for the AutoscalingPolicys API. Describes an autoscaling policy for Dataproc cluster autoscaler.
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp}
type AutoscalingPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AutoscalingPolicySpec `json:"spec"`
Status AutoscalingPolicyStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// AutoscalingPolicyList contains a list of AutoscalingPolicys
type AutoscalingPolicyList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AutoscalingPolicy `json:"items"`
}
// Repository type metadata.
var (
AutoscalingPolicy_Kind = "AutoscalingPolicy"
AutoscalingPolicy_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: AutoscalingPolicy_Kind}.String()
AutoscalingPolicy_KindAPIVersion = AutoscalingPolicy_Kind + "." + CRDGroupVersion.String()
AutoscalingPolicy_GroupVersionKind = CRDGroupVersion.WithKind(AutoscalingPolicy_Kind)
)
func init() {
SchemeBuilder.Register(&AutoscalingPolicy{}, &AutoscalingPolicyList{})
}