/
backend_types.go
495 lines (459 loc) · 20.7 KB
/
backend_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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
/*
Copyright 2021.
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 (
"github.com/3scale/saas-operator/pkg/util"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/pointer"
)
var (
backendDefaultImage defaultImageSpec = defaultImageSpec{
Name: pointer.String("quay.io/3scale/apisonator"),
Tag: pointer.String("nightly"),
PullPolicy: (*corev1.PullPolicy)(pointer.String(string(corev1.PullIfNotPresent))),
}
backendDefaultGrafanaDashboard defaultGrafanaDashboardSpec = defaultGrafanaDashboardSpec{
SelectorKey: pointer.String("monitoring-key"),
SelectorValue: pointer.String("middleware"),
}
backendDefaultConfigRackEnv string = "dev"
backendDefaultConfigMasterServiceID int32 = 6
backendDefaultListenerHPA defaultHorizontalPodAutoscalerSpec = defaultHorizontalPodAutoscalerSpec{
MinReplicas: pointer.Int32(2),
MaxReplicas: pointer.Int32(4),
ResourceUtilization: pointer.Int32(90),
ResourceName: pointer.String("cpu"),
}
backendDefaultListenerPDB defaultPodDisruptionBudgetSpec = defaultPodDisruptionBudgetSpec{
MaxUnavailable: util.IntStrPtr(intstr.FromInt(1)),
}
backendDefaultListenerNLBLoadBalancer defaultNLBLoadBalancerSpec = defaultNLBLoadBalancerSpec{
ProxyProtocol: pointer.Bool(true),
CrossZoneLoadBalancingEnabled: pointer.Bool(true),
}
backendDefaultListenerReplicas int32 = 2
backendDefaultListenerResources defaultResourceRequirementsSpec = defaultResourceRequirementsSpec{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("500m"),
corev1.ResourceMemory: resource.MustParse("550Mi"),
},
Limits: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("1"),
corev1.ResourceMemory: resource.MustParse("700Mi"),
},
}
backendDefaultListenerLivenessProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(30),
TimeoutSeconds: pointer.Int32(1),
PeriodSeconds: pointer.Int32(10),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
}
backendDefaultListenerReadinessProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(30),
TimeoutSeconds: pointer.Int32(5),
PeriodSeconds: pointer.Int32(10),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
}
backendDefaultListenerMarin3rSpec defaultMarin3rSidecarSpec = defaultMarin3rSidecarSpec{}
backendDefaultListenerConfigLogFormat string = "json"
backendDefaultListenerConfigRedisAsync bool = false
backendDefaultListenerConfigListenerWorkers int32 = 16
backendDefaultListenerConfigLegacyReferrerFilters bool = true
backendDefaultWorkerHPA defaultHorizontalPodAutoscalerSpec = defaultHorizontalPodAutoscalerSpec{
MinReplicas: pointer.Int32(2),
MaxReplicas: pointer.Int32(4),
ResourceUtilization: pointer.Int32(90),
ResourceName: pointer.String("cpu"),
}
backendDefaultWorkerPDB defaultPodDisruptionBudgetSpec = defaultPodDisruptionBudgetSpec{
MaxUnavailable: util.IntStrPtr(intstr.FromInt(1)),
}
backendDefaultWorkerReplicas int32 = 2
backendDefaultWorkerResources defaultResourceRequirementsSpec = defaultResourceRequirementsSpec{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("150m"),
corev1.ResourceMemory: resource.MustParse("50Mi"),
},
Limits: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("1"),
corev1.ResourceMemory: resource.MustParse("300Mi"),
},
}
backendDefaultWorkerLivenessProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(10),
TimeoutSeconds: pointer.Int32(3),
PeriodSeconds: pointer.Int32(15),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
}
backendDefaultWorkerReadinessProbe defaultProbeSpec = defaultProbeSpec{
InitialDelaySeconds: pointer.Int32(10),
TimeoutSeconds: pointer.Int32(5),
PeriodSeconds: pointer.Int32(30),
SuccessThreshold: pointer.Int32(1),
FailureThreshold: pointer.Int32(3),
}
backendDefaultWorkerConfigLogFormat string = "json"
backendDefaultWorkerConfigRedisAsync bool = false
backendDefaultCronReplicas int32 = 1
backendDefaultCronResources defaultResourceRequirementsSpec = defaultResourceRequirementsSpec{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("50m"),
corev1.ResourceMemory: resource.MustParse("50Mi"),
},
Limits: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("150m"),
corev1.ResourceMemory: resource.MustParse("150Mi"),
},
}
)
// BackendSpec defines the desired state of Backend
type BackendSpec struct {
// Image specification for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Image *ImageSpec `json:"image,omitempty"`
// Application specific configuration options for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
Config BackendConfig `json:"config"`
// Configures the Grafana Dashboard for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
GrafanaDashboard *GrafanaDashboardSpec `json:"grafanaDashboard,omitempty"`
// Configures the backend listener
// +operator-sdk:csv:customresourcedefinitions:type=spec
Listener ListenerSpec `json:"listener"`
// Configures the backend worker
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Worker *WorkerSpec `json:"worker,omitempty"`
// Configures the backend cron
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Cron *CronSpec `json:"cron,omitempty"`
// Configures twemproxy
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Twemproxy *TwemproxySpec `json:"twemproxy,omitempty"`
}
// Default implements defaulting for BackendSpec
func (spec *BackendSpec) Default() {
spec.Image = InitializeImageSpec(spec.Image, backendDefaultImage)
spec.Config.Default()
spec.Listener.Default()
if spec.Worker == nil {
spec.Worker = &WorkerSpec{}
}
spec.Worker.Default()
if spec.Cron == nil {
spec.Cron = &CronSpec{}
}
spec.Cron.Default()
spec.GrafanaDashboard = InitializeGrafanaDashboardSpec(spec.GrafanaDashboard, backendDefaultGrafanaDashboard)
if spec.Twemproxy != nil {
spec.Twemproxy.Default()
}
}
// ResolveCanarySpec modifies the BackendSpec given the provided canary configuration
func (spec *BackendSpec) ResolveCanarySpec(canary *Canary) (*BackendSpec, error) {
canarySpec := &BackendSpec{}
if err := canary.PatchSpec(spec, canarySpec); err != nil {
return nil, err
}
if canary.ImageName != nil {
canarySpec.Image.Name = canary.ImageName
}
if canary.ImageTag != nil {
canarySpec.Image.Tag = canary.ImageTag
}
canarySpec.Listener.Replicas = canary.Replicas
canarySpec.Worker.Replicas = canary.Replicas
canarySpec.Cron.Replicas = canary.Replicas
// Call Default() on the resolved canary spec to apply
// defaulting to potentially added fields
canarySpec.Default()
return canarySpec, nil
}
// ListenerSpec is the configuration for Backend Listener
type ListenerSpec struct {
// Listener specific configuration options for the component element
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Config *ListenerConfig `json:"config,omitempty"`
// Pod Disruption Budget for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
PDB *PodDisruptionBudgetSpec `json:"pdb,omitempty"`
// Horizontal Pod Autoscaler for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
HPA *HorizontalPodAutoscalerSpec `json:"hpa,omitempty"`
// Number of replicas (ignored if hpa is enabled) for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// Resource requirements for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Resources *ResourceRequirementsSpec `json:"resources,omitempty"`
// Liveness probe for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
LivenessProbe *ProbeSpec `json:"livenessProbe,omitempty"`
// Readiness probe for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
ReadinessProbe *ProbeSpec `json:"readinessProbe,omitempty"`
// The external endpoint/s for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
Endpoint Endpoint `json:"endpoint"`
// Marin3r configures the Marin3r sidecars for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Marin3r *Marin3rSidecarSpec `json:"marin3r,omitempty"`
// Configures the AWS Network load balancer for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
LoadBalancer *NLBLoadBalancerSpec `json:"loadBalancer,omitempty"`
// Describes node affinity scheduling rules for the pod.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeAffinity"`
// If specified, the pod's tolerations.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
// Canary defines spec changes for the canary Deployment. If
// left unset the canary Deployment wil not be created.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Canary *Canary `json:"canary,omitempty"`
}
// Default implements defaulting for the each backend listener
func (spec *ListenerSpec) Default() {
spec.HPA = InitializeHorizontalPodAutoscalerSpec(spec.HPA, backendDefaultListenerHPA)
spec.Replicas = intOrDefault(spec.Replicas, &backendDefaultListenerReplicas)
spec.PDB = InitializePodDisruptionBudgetSpec(spec.PDB, backendDefaultListenerPDB)
spec.Resources = InitializeResourceRequirementsSpec(spec.Resources, backendDefaultListenerResources)
spec.LivenessProbe = InitializeProbeSpec(spec.LivenessProbe, backendDefaultListenerLivenessProbe)
spec.ReadinessProbe = InitializeProbeSpec(spec.ReadinessProbe, backendDefaultListenerReadinessProbe)
spec.LoadBalancer = InitializeNLBLoadBalancerSpec(spec.LoadBalancer, backendDefaultListenerNLBLoadBalancer)
spec.Marin3r = InitializeMarin3rSidecarSpec(spec.Marin3r, backendDefaultListenerMarin3rSpec)
if spec.Config == nil {
spec.Config = &ListenerConfig{}
}
spec.Config.Default()
}
// WorkerSpec is the configuration for Backend Worker
type WorkerSpec struct {
// Listener specific configuration options for the component element
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Config *WorkerConfig `json:"config,omitempty"`
// Pod Disruption Budget for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
PDB *PodDisruptionBudgetSpec `json:"pdb,omitempty"`
// Horizontal Pod Autoscaler for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
HPA *HorizontalPodAutoscalerSpec `json:"hpa,omitempty"`
// Number of replicas (ignored if hpa is enabled) for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// Resource requirements for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Resources *ResourceRequirementsSpec `json:"resources,omitempty"`
// Liveness probe for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
LivenessProbe *ProbeSpec `json:"livenessProbe,omitempty"`
// Readiness probe for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
ReadinessProbe *ProbeSpec `json:"readinessProbe,omitempty"`
// Describes node affinity scheduling rules for the pod.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeAffinity"`
// If specified, the pod's tolerations.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
// Canary defines spec changes for the canary Deployment. If
// left unset the canary Deployment wil not be created.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Canary *Canary `json:"canary,omitempty"`
}
// Default implements defaulting for the each backend worker
func (spec *WorkerSpec) Default() {
spec.HPA = InitializeHorizontalPodAutoscalerSpec(spec.HPA, backendDefaultWorkerHPA)
spec.Replicas = intOrDefault(spec.Replicas, &backendDefaultWorkerReplicas)
spec.PDB = InitializePodDisruptionBudgetSpec(spec.PDB, backendDefaultWorkerPDB)
spec.Resources = InitializeResourceRequirementsSpec(spec.Resources, backendDefaultWorkerResources)
spec.LivenessProbe = InitializeProbeSpec(spec.LivenessProbe, backendDefaultWorkerLivenessProbe)
spec.ReadinessProbe = InitializeProbeSpec(spec.ReadinessProbe, backendDefaultWorkerReadinessProbe)
if spec.Config == nil {
spec.Config = &WorkerConfig{}
}
spec.Config.Default()
}
// CronSpec is the configuration for Backend Cron
type CronSpec struct {
// Number of replicas for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// Resource requirements for the component
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Resources *ResourceRequirementsSpec `json:"resources,omitempty"`
// Describes node affinity scheduling rules for the pod.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeAffinity"`
// If specified, the pod's tolerations.
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`
}
// Default implements defaulting for the each backend cron
func (spec *CronSpec) Default() {
spec.Replicas = intOrDefault(spec.Replicas, &backendDefaultCronReplicas)
spec.Resources = InitializeResourceRequirementsSpec(spec.Resources, backendDefaultCronResources)
}
// BackendConfig configures app behavior for Backend
type BackendConfig struct {
// Rack environment
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
RackEnv *string `json:"rackEnv,omitempty"`
// Master service account ID in Porta
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
MasterServiceID *int32 `json:"masterServiceID,omitempty"`
// Redis Storage DSN
// +operator-sdk:csv:customresourcedefinitions:type=spec
RedisStorageDSN string `json:"redisStorageDSN"`
// Redis Queues DSN
// +operator-sdk:csv:customresourcedefinitions:type=spec
RedisQueuesDSN string `json:"redisQueuesDSN"`
// External Secret common configuration
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
ExternalSecret ExternalSecret `json:"externalSecret,omitempty"`
// A reference to the secret holding the backend-system-events-hook URL
// +operator-sdk:csv:customresourcedefinitions:type=spec
SystemEventsHookURL SecretReference `json:"systemEventsHookURL"`
// A reference to the secret holding the backend-system-events-hook password
// +operator-sdk:csv:customresourcedefinitions:type=spec
SystemEventsHookPassword SecretReference `json:"systemEventsHookPassword"`
// A reference to the secret holding the backend-internal-api user
// +operator-sdk:csv:customresourcedefinitions:type=spec
InternalAPIUser SecretReference `json:"internalAPIUser"`
// A reference to the secret holding the backend-internal-api password
// +operator-sdk:csv:customresourcedefinitions:type=spec
InternalAPIPassword SecretReference `json:"internalAPIPassword"`
// A reference to the secret holding the backend-error-monitoring service
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
ErrorMonitoringService *SecretReference `json:"errorMonitoringService,omitempty"`
// A reference to the secret holding the backend-error-monitoring key
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
ErrorMonitoringKey *SecretReference `json:"errorMonitoringKey,omitempty"`
}
// Default sets default values for any value not specifically set in the BackendConfig struct
func (cfg *BackendConfig) Default() {
cfg.RackEnv = stringOrDefault(cfg.RackEnv, pointer.String(backendDefaultConfigRackEnv))
cfg.MasterServiceID = intOrDefault(cfg.MasterServiceID, pointer.Int32(backendDefaultConfigMasterServiceID))
cfg.ExternalSecret.SecretStoreRef = InitializeExternalSecretSecretStoreReferenceSpec(cfg.ExternalSecret.SecretStoreRef, defaultExternalSecretSecretStoreReference)
cfg.ExternalSecret.RefreshInterval = durationOrDefault(cfg.ExternalSecret.RefreshInterval, &defaultExternalSecretRefreshInterval)
}
// ListenerConfig configures app behavior for Backend Listener
type ListenerConfig struct {
// Listener log format
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +kubebuilder:validation:Enum=test;json
// +optional
LogFormat *string `json:"logFormat,omitempty"`
// Enable (true) or disable (false) listener redis async mode
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
RedisAsync *bool `json:"redisAsync,omitempty"`
// Number of worker processes per listener pod
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
ListenerWorkers *int32 `json:"listenerWorkers,omitempty"`
// Enable (true) or disable (false) Legacy Referrer Filters
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
LegacyReferrerFilters *bool `json:"legacyReferrerFilters,omitempty"`
}
// Default sets default values for any value not specifically set in the ListenerConfig struct
func (cfg *ListenerConfig) Default() {
cfg.LogFormat = stringOrDefault(cfg.LogFormat, pointer.String(backendDefaultListenerConfigLogFormat))
cfg.RedisAsync = boolOrDefault(cfg.RedisAsync, pointer.Bool(backendDefaultListenerConfigRedisAsync))
cfg.ListenerWorkers = intOrDefault(cfg.ListenerWorkers, pointer.Int32(backendDefaultListenerConfigListenerWorkers))
cfg.LegacyReferrerFilters = boolOrDefault(cfg.LegacyReferrerFilters, pointer.Bool(backendDefaultListenerConfigLegacyReferrerFilters))
}
// WorkerConfig configures app behavior for Backend Worker
type WorkerConfig struct {
// Worker log format
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +kubebuilder:validation:Enum=test;json
// +optional
LogFormat *string `json:"logFormat,omitempty"`
// Enable (true) or disable (false) worker redis async mode
// +operator-sdk:csv:customresourcedefinitions:type=spec
// +optional
RedisAsync *bool `json:"redisAsync,omitempty"`
}
// Default sets default values for any value not specifically set in the WorkerConfig struct
func (cfg *WorkerConfig) Default() {
cfg.LogFormat = stringOrDefault(cfg.LogFormat, pointer.String(backendDefaultWorkerConfigLogFormat))
cfg.RedisAsync = boolOrDefault(cfg.RedisAsync, pointer.Bool(backendDefaultWorkerConfigRedisAsync))
}
// BackendStatus defines the observed state of Backend
type BackendStatus struct{}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// Backend is the Schema for the backends API
type Backend struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BackendSpec `json:"spec,omitempty"`
Status BackendStatus `json:"status,omitempty"`
}
// Defaults impletements defaulting for the Apicast resource
func (b *Backend) Default() {
b.Spec.Default()
}
// +kubebuilder:object:root=true
// BackendList contains a list of Backend
type BackendList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Backend `json:"items"`
}
func init() {
SchemeBuilder.Register(&Backend{}, &BackendList{})
}