-
Notifications
You must be signed in to change notification settings - Fork 277
Expand file tree
/
Copy pathoperations.kubeblocks.io_opsrequests.yaml
More file actions
executable file
·5419 lines (5334 loc) · 388 KB
/
Copy pathoperations.kubeblocks.io_opsrequests.yaml
File metadata and controls
executable file
·5419 lines (5334 loc) · 388 KB
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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
labels:
app.kubernetes.io/name: kubeblocks
name: opsrequests.operations.kubeblocks.io
spec:
group: operations.kubeblocks.io
names:
categories:
- kubeblocks
kind: OpsRequest
listKind: OpsRequestList
plural: opsrequests
shortNames:
- ops
singular: opsrequest
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Operation request type.
jsonPath: .spec.type
name: TYPE
type: string
- description: Operand cluster.
jsonPath: .spec.clusterName
name: CLUSTER
type: string
- description: Operation status phase.
jsonPath: .status.phase
name: STATUS
type: string
- description: Operation processing progress.
jsonPath: .status.progress
name: PROGRESS
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: OpsRequest is the Schema for the opsrequests API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: OpsRequestSpec defines the desired state of OpsRequest
properties:
backup:
description: Specifies the parameters to back up a Cluster.
properties:
backupMethod:
description: |-
Specifies the name of BackupMethod.
The specified BackupMethod must be defined in the BackupPolicy.
type: string
backupName:
description: Specifies the name of the Backup custom resource.
type: string
backupPolicyName:
description: Indicates the name of the BackupPolicy applied to
perform this Backup.
type: string
deletionPolicy:
default: Delete
description: |-
Determines whether the backup contents stored in backup repository
should be deleted when the Backup custom resource is deleted.
Supported values are `Retain` and `Delete`.
- `Retain` means that the backup content and its physical snapshot on backup repository are kept.
- `Delete` means that the backup content and its physical snapshot on backup repository are deleted.
enum:
- Delete
- Retain
type: string
parameters:
description: |-
Specifies a list of name-value pairs representing parameters and their corresponding values.
Parameters match the schema specified in the `actionset.spec.parametersSchema`
items:
properties:
name:
description: Represents the name of the parameter.
type: string
value:
description: Represents the parameter values.
type: string
required:
- name
- value
type: object
maxItems: 128
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
x-kubernetes-validations:
- message: forbidden to update parameters
rule: self == oldSelf
parentBackupName:
description: If the specified BackupMethod is incremental, `parentBackupName`
is required.
type: string
retentionPeriod:
description: |-
Determines the duration for which the Backup custom resources should be retained.
The controller will automatically remove all Backup objects that are older than the specified RetentionPeriod.
For example, RetentionPeriod of `30d` will keep only the Backup objects of last 30 days.
Sample duration format:
- years: 2y
- months: 6mo
- days: 30d
- hours: 12h
- minutes: 30m
You can also combine the above durations. For example: 30d12h30m.
If not set, the Backup objects will be kept forever.
If the `deletionPolicy` is set to 'Delete', then the associated backup data will also be deleted
along with the Backup object.
Otherwise, only the Backup custom resource will be deleted.
type: string
type: object
x-kubernetes-validations:
- message: forbidden to update backup.parameters
rule: has(oldSelf.parameters) == has(self.parameters)
cancel:
description: |-
Indicates whether the current operation should be canceled and terminated gracefully if it's in the
"Pending", "Creating", or "Running" state.
This field applies only to "VerticalScaling" and "HorizontalScaling" opsRequests.
Note: Setting `cancel` to true is irreversible; further modifications to this field are ineffective.
type: boolean
clusterName:
description: Specifies the name of the Cluster resource that this
operation is targeting.
type: string
x-kubernetes-validations:
- message: forbidden to update spec.clusterName
rule: self == oldSelf
custom:
description: Specifies a custom operation defined by OpsDefinition.
properties:
components:
description: |-
Specifies the components and their parameters for executing custom actions as defined in OpsDefinition.
Requires at least one component.
items:
properties:
componentName:
description: Specifies the name of the Component as defined
in the cluster.spec
type: string
parameters:
description: Specifies the parameters that match the schema
specified in the `opsDefinition.spec.parametersSchema`.
items:
properties:
name:
description: Specifies the identifier of the parameter
as defined in the OpsDefinition.
type: string
value:
description: |-
Holds the data associated with the parameter.
If the parameter type is an array, the format should be "v1,v2,v3".
type: string
valueFrom:
description: Source for the parameter's value. Cannot
be used if value is not empty.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the ConfigMap
or its key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
secretKeyRef:
description: Selects a key of a Secret.
properties:
key:
description: The key of the secret to select
from. Must be a valid secret key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or
its key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
required:
- name
- value
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
required:
- componentName
type: object
maxItems: 1024
minItems: 1
type: array
x-kubernetes-list-map-keys:
- componentName
x-kubernetes-list-type: map
maxConcurrentComponents:
anyOf:
- type: integer
- type: string
description: |-
Specifies the maximum number of components to be operated on concurrently to mitigate performance impact
on clusters with multiple components.
It accepts an absolute number (e.g., 5) or a percentage of components to execute in parallel (e.g., "10%").
Percentages are rounded up to the nearest whole number of components.
For example, if "10%" results in less than one, it rounds up to 1.
When unspecified, all components are processed simultaneously by default.
Note: This feature is not implemented yet.
x-kubernetes-int-or-string: true
opsDefinitionName:
description: Specifies the name of the OpsDefinition.
type: string
serviceAccountName:
description: Specifies the name of the ServiceAccount to be used
for executing the custom operation.
type: string
required:
- components
- opsDefinitionName
type: object
enqueueOnForce:
default: false
description: Indicates whether opsRequest should continue to queue
when 'force' is set to true.
type: boolean
expose:
description: Lists Expose objects, each specifying a Component and
its services to be exposed.
items:
properties:
componentName:
description: Specifies the name of the Component.
type: string
services:
description: |-
Specifies a list of OpsService.
When an OpsService is exposed, a corresponding ClusterService will be added to `cluster.spec.services`.
On the other hand, when an OpsService is unexposed, the corresponding ClusterService will be removed
from `cluster.spec.services`.
Note: If `componentName` is not specified, the `ports` and `selector` fields must be provided
in each OpsService definition.
items:
description: OpsService represents the parameters to dynamically
create or remove a ClusterService in the `cluster.spec.services`
array.
properties:
annotations:
additionalProperties:
type: string
description: |-
Contains cloud provider related parameters if ServiceType is LoadBalancer.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer.
type: object
externalTrafficPolicy:
description: |-
Specifies the external traffic policy of the Service. This controls how external traffic is routed to node-local or cluster-wide endpoints.
Possible values:
- `Cluster` (default for NodePort): Routes external traffic to all ready endpoints of the Service.
This preserves the original source IP and avoids a second hop for LoadBalancer and NodePort services.
- `Local`: Routes external traffic only to node-local endpoints.
If no node-local endpoints exist, traffic is dropped. This ensures that the source IP is exposed.
This field is only applicable to LoadBalancer and NodePort services.
type: string
internalTrafficPolicy:
description: |-
Specifies the internal traffic policy of the Service. This controls how traffic from internal sources
is routed.
Possible values:
- `Cluster` (default): Routes internal traffic to all ready endpoints of the Service.
This distributes traffic evenly across all endpoints.
- `Local`: Routes internal traffic only to node-local endpoints.
If no node-local endpoints exist, traffic is dropped.
This field can be specified on any Service type.
type: string
ipFamilies:
description: |-
A list of IP families (e.g., IPv4, IPv6) assigned to this Service.
Usually assigned automatically based on the cluster configuration and the `ipFamilyPolicy` field.
If specified manually, the requested IP family must be available in the cluster and allowed by the `ipFamilyPolicy`.
If the requested IP family is not available or not allowed, the Service creation will fail.
Valid values:
- "IPv4"
- "IPv6"
This field may hold a maximum of two entries (dual-stack families, in either order).
Common combinations of `ipFamilies` and `ipFamilyPolicy` are:
- ipFamilies=[] + ipFamilyPolicy="PreferDualStack" :
The Service prefers dual-stack but can fall back to single-stack if the cluster does not support dual-stack.
The IP family is automatically assigned based on the cluster configuration.
- ipFamilies=["IPV4","IPV6"] + ipFamilyPolicy="RequiredDualStack" :
The Service requires dual-stack and will only be created if the cluster supports both IPv4 and IPv6.
The primary IP family is IPV4.
- ipFamilies=["IPV6","IPV4"] + ipFamilyPolicy="RequiredDualStack" :
The Service requires dual-stack and will only be created if the cluster supports both IPv4 and IPv6.
The primary IP family is IPV6.
- ipFamilies=["IPV4"] + ipFamilyPolicy="SingleStack" :
The Service uses a single-stack with IPv4 only.
- ipFamilies=["IPV6"] + ipFamilyPolicy="SingleStack" :
The Service uses a single-stack with IPv6 only.
items:
description: |-
IPFamily represents the IP Family (IPv4 or IPv6). This type is used
to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies).
type: string
type: array
x-kubernetes-list-type: atomic
ipFamilyPolicy:
description: |-
Specifies whether the Service should use a single IP family (SingleStack) or two IP families (DualStack).
Possible values:
- 'SingleStack' (default) : The Service uses a single IP family.
If no value is provided, IPFamilyPolicy defaults to SingleStack.
- 'PreferDualStack' : The Service prefers to use two IP families on dual-stack configured clusters
or a single IP family on single-stack clusters.
- 'RequiredDualStack' : The Service requires two IP families on dual-stack configured clusters.
If the cluster is not configured for dual-stack, the Service creation fails.
type: string
name:
description: |-
Specifies the name of the Service. This name is used to set `clusterService.name`.
Note: This field cannot be updated.
type: string
podSelector:
additionalProperties:
type: string
description: |-
Routes service traffic to pods with matching label keys and values.
If specified, the service will only be exposed to pods matching the selector.
Note: If the component has roles, at least one of 'roleSelector' or 'podSelector' must be specified.
If both are specified, a pod must match both conditions to be selected.
type: object
x-kubernetes-map-type: atomic
ports:
description: |-
Specifies Port definitions that are to be exposed by a ClusterService.
If not specified, the Port definitions from non-NodePort and non-LoadBalancer type ComponentService
defined in the ComponentDefinition (`componentDefinition.spec.services`) will be used.
If no matching ComponentService is found, the expose operation will fail.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
items:
description: ServicePort contains information on service's
port.
properties:
appProtocol:
description: |-
The application protocol for this port.
This is used as a hint for implementations to offer richer behavior for protocols that they understand.
This field follows standard Kubernetes label syntax.
Valid values are either:
* Un-prefixed protocol names - reserved for IANA standard service names (as per
RFC-6335 and https://www.iana.org/assignments/service-names).
* Kubernetes-defined prefixed names:
* 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-
* 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455
* 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455
* Other protocols should use implementation-defined prefixed names such as
mycompany.com/my-custom-protocol.
type: string
name:
description: |-
The name of this port within the service. This must be a DNS_LABEL.
All ports within a ServiceSpec must have unique names. When considering
the endpoints for a Service, this must match the 'name' field in the
EndpointPort.
Optional if only one ServicePort is defined on this service.
type: string
nodePort:
description: |-
The port on each node on which this service is exposed when type is
NodePort or LoadBalancer. Usually assigned by the system. If a value is
specified, in-range, and not in use it will be used, otherwise the
operation will fail. If not specified, a port will be allocated if this
Service requires one. If this field is specified when creating a
Service which does not need it, creation will fail. This field will be
wiped when updating a Service to no longer need it (e.g. changing type
from NodePort to ClusterIP).
More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
format: int32
type: integer
port:
description: The port that will be exposed by this
service.
format: int32
type: integer
protocol:
default: TCP
description: |-
The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
Default is TCP.
type: string
targetPort:
anyOf:
- type: integer
- type: string
description: |-
Number or name of the port to access on the pods targeted by the service.
Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
If this is a string, it will be looked up as a named port in the
target Pod's container ports. If this is not specified, the value
of the 'port' field is used (an identity map).
This field is ignored for services with clusterIP=None, and should be
omitted or set equal to the 'port' field.
More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
x-kubernetes-int-or-string: true
required:
- port
type: object
type: array
x-kubernetes-list-map-keys:
- port
- protocol
x-kubernetes-list-type: map
roleSelector:
description: |-
Specifies a role to target with the service.
If specified, the service will only be exposed to pods with the matching role.
Note: If the component has roles, at least one of 'roleSelector' or 'podSelector' must be specified.
If both are specified, a pod must match both conditions to be selected.
type: string
serviceType:
description: |-
Determines how the Service is exposed. Defaults to 'ClusterIP'.
Valid options are `ClusterIP`, `NodePort`, and `LoadBalancer`.
- `ClusterIP`: allocates a cluster-internal IP address for load-balancing to endpoints.
Endpoints are determined by the selector or if that is not specified,
they are determined by manual construction of an Endpoints object or EndpointSlice objects.
- `NodePort`: builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP.
- `LoadBalancer`: builds on NodePort and creates an external load-balancer (if supported in the current cloud)
which routes to the same endpoints as the clusterIP.
Note: although K8s Service type allows the 'ExternalName' type, it is not a valid option for the expose operation.
For more info, see:
https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types.
type: string
required:
- name
type: object
type: array
switch:
description: |-
Indicates whether the services will be exposed.
'Enable' exposes the services. while 'Disable' removes the exposed Service.
enum:
- Enable
- Disable
type: string
required:
- services
- switch
type: object
type: array
force:
description: |-
Instructs the system to bypass pre-checks (including cluster state checks and customized pre-conditions hooks)
and immediately execute the opsRequest, except for the opsRequest of 'Start' type, which will still undergo
pre-checks even if `force` is true.
This is useful for concurrent execution of 'VerticalScaling' and 'HorizontalScaling' opsRequests.
By setting `force` to true, you can bypass the default checks and demand these opsRequests to run
simultaneously.
Note: Once set, the `force` field is immutable and cannot be updated.
type: boolean
x-kubernetes-validations:
- message: forbidden to update spec.force
rule: self == oldSelf
horizontalScaling:
description: |-
Lists HorizontalScaling objects, each specifying scaling requirements for a Component,
including desired replica changes, configurations for new instances, modifications for existing instances,
and take offline/online the specified instances.
items:
description: HorizontalScaling defines the parameters of a horizontal
scaling operation.
properties:
componentName:
description: Specifies the name of the Component as defined
in the cluster.spec
type: string
scaleIn:
description: |-
Specifies the replica changes for scaling in components and instance templates,
and takes specified instances offline. Can be used in conjunction with the "scaleOut" operation.
Note: Any configuration that creates instances is considered invalid.
properties:
instances:
description: |-
Modifies the desired replicas count for existing InstanceTemplate.
if the inst
items:
description: InstanceReplicasTemplate defines the template
for instance replicas.
properties:
name:
description: Specifies the name of the instance template.
type: string
replicaChanges:
description: Specifies the replica changes for the
instance template.
format: int32
minimum: 0
type: integer
required:
- name
- replicaChanges
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
onlineInstancesToOffline:
description: Specifies the instance names that need to be
taken offline.
items:
type: string
type: array
replicaChanges:
description: Specifies the replica changes for the component.
format: int32
minimum: 0
type: integer
type: object
scaleOut:
description: |-
Specifies the replica changes for scaling out components and instance templates,
and brings offline instances back online. Can be used in conjunction with the "scaleIn" operation.
Note: Any configuration that deletes instances is considered invalid.
properties:
fromBackup:
description: |-
FromBackup specifies the configuration for creating new instances from an existing backup.
This is only effective for non-sharding components.
When specified, new instances will be created using data from the specified backup.
properties:
name:
description: Specifies the name of the Backup name.
type: string
namespace:
description: |-
Specifies the namespace of the Backup.
If not specified, the namespace of the OpsRequest will be used.
Cross-namespace VolumeSnapshot restores are NOT supported.
type: string
restoreEnv:
description: |-
Defines container environment variables for the restore process.
merged with the ones specified in the Backup and ActionSet resources.
Merge priority: Restore env > Backup env > ActionSet env.
Purpose: Some databases require different configurations when being restored as a standby
compared to being restored as a primary.
For example, when restoring MySQL as a replica, you need to set `skip_slave_start="ON"` for 5.7
or `skip_replica_start="ON"` for 8.0.
Allowing environment variables to be passed in makes it more convenient to control these behavioral differences
during the restore process.
items:
description: EnvVar represents an environment variable
present in a Container.
properties:
name:
description: Name of the environment variable.
Must be a C_IDENTIFIER.
type: string
value:
description: |-
Variable references $(VAR_NAME) are expanded
using the previously defined environment variables in the container and
any service environment variables. If a variable cannot be resolved,
the reference in the input string will be unchanged. Double $$ are reduced
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
Escaped references will never be expanded, regardless of whether the variable
exists or not.
Defaults to "".
type: string
valueFrom:
description: Source for the environment variable's
value. Cannot be used if value is not empty.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the ConfigMap
or its key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
fieldRef:
description: |-
Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
properties:
apiVersion:
description: Version of the schema the
FieldPath is written in terms of, defaults
to "v1".
type: string
fieldPath:
description: Path of the field to select
in the specified API version.
type: string
required:
- fieldPath
type: object
x-kubernetes-map-type: atomic
resourceFieldRef:
description: |-
Selects a resource of the container: only resources limits and requests
(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
properties:
containerName:
description: 'Container name: required
for volumes, optional for env vars'
type: string
divisor:
anyOf:
- type: integer
- type: string
description: Specifies the output format
of the exposed resources, defaults to
"1"
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
resource:
description: 'Required: resource to select'
type: string
required:
- resource
type: object
x-kubernetes-map-type: atomic
secretKeyRef:
description: Selects a key of a secret in
the pod's namespace
properties:
key:
description: The key of the secret to
select from. Must be a valid secret
key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret
or its key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
required:
- name
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
restorePointInTime:
description: |-
Specifies the point in time to which the restore should be performed.
Supported time formats:
- RFC3339 format, e.g. "2023-11-25T18:52:53Z"
- A human-readable date-time format, e.g. "Jul 25,2023 18:52:53 UTC+0800"
type: string
sourceTargetName:
description: |-
Specifies the backup source target name to restore from.
This field is required when the referenced Backup has multiple source targets.
It is propagated to Restore.spec.backup.sourceTargetName.
type: string
required:
- name
type: object
instances:
description: |-
Modifies the desired replicas count for existing InstanceTemplate.
if the inst
items:
description: InstanceReplicasTemplate defines the template
for instance replicas.
properties:
name:
description: Specifies the name of the instance template.
type: string
replicaChanges:
description: Specifies the replica changes for the
instance template.
format: int32
minimum: 0
type: integer
required:
- name
- replicaChanges
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
newInstances:
description: |-
Defines the configuration for new instances added during scaling, including resource requirements, labels, annotations, etc.
New instances are created based on the provided instance templates.
items:
description: InstanceTemplate allows customization of
individual replica configurations in a Component.
properties:
annotations:
additionalProperties:
type: string
description: |-
Specifies a map of key-value pairs to be merged into the Pod's existing annotations.
Existing keys will have their values overwritten, while new keys will be added to the annotations.
type: object
canary:
description: Indicate whether the instances belonging
to this template are canary instances.
type: boolean
compDef:
description: Specifies the name of the referenced
ComponentDefinition.
maxLength: 64
type: string
env:
description: |-
Defines Env to override.
Add new or override existing envs.
items:
description: EnvVar represents an environment variable
present in a Container.
properties:
name:
description: Name of the environment variable.
Must be a C_IDENTIFIER.
type: string
value:
description: |-
Variable references $(VAR_NAME) are expanded
using the previously defined environment variables in the container and
any service environment variables. If a variable cannot be resolved,
the reference in the input string will be unchanged. Double $$ are reduced
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
Escaped references will never be expanded, regardless of whether the variable
exists or not.
Defaults to "".
type: string
valueFrom:
description: Source for the environment variable's
value. Cannot be used if value is not empty.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the ConfigMap
or its key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
fieldRef:
description: |-
Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
properties:
apiVersion:
description: Version of the schema the
FieldPath is written in terms of,
defaults to "v1".
type: string
fieldPath:
description: Path of the field to select
in the specified API version.
type: string
required:
- fieldPath
type: object
x-kubernetes-map-type: atomic
resourceFieldRef:
description: |-
Selects a resource of the container: only resources limits and requests
(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
properties:
containerName:
description: 'Container name: required
for volumes, optional for env vars'
type: string
divisor:
anyOf:
- type: integer
- type: string
description: Specifies the output format
of the exposed resources, defaults
to "1"
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
resource:
description: 'Required: resource to
select'
type: string
required:
- resource
type: object
x-kubernetes-map-type: atomic
secretKeyRef:
description: Selects a key of a secret in
the pod's namespace
properties:
key:
description: The key of the secret to
select from. Must be a valid secret
key.
type: string
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret
or its key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
required:
- name
type: object
type: array
labels:
additionalProperties:
type: string
description: |-
Specifies a map of key-value pairs that will be merged into the Pod's existing labels.
Values for existing keys will be overwritten, and new keys will be added.
type: object
name:
description: |-
Name specifies the unique name of the instance Pod created using this InstanceTemplate.
This name is constructed by concatenating the Component's name, the template's name, and the instance's ordinal
using the pattern: $(cluster.name)-$(component.name)-$(template.name)-$(ordinal). Ordinals start from 0.
The name can't be empty.
maxLength: 54
pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
type: string
ordinals:
description: |-
Specifies the desired Ordinals of this InstanceTemplate.
The Ordinals used to specify the ordinal of the instance (pod) names to be generated under this InstanceTemplate.
If Ordinals are defined, their number must be equal to or more than the corresponding replicas.
For example, if Ordinals is {ranges: [{start: 0, end: 1}], discrete: [7]},
then the instance names generated under this InstanceTemplate would be
$(cluster.name)-$(component.name)-$(template.name)-0、$(cluster.name)-$(component.name)-$(template.name)-1 and
$(cluster.name)-$(component.name)-$(template.name)-7
properties:
discrete:
items:
format: int32
type: integer
type: array
ranges:
items:
description: |-
Range represents a range with a start and an end value. Both start and end are included.
It is used to define a continuous segment.
properties:
end:
format: int32
type: integer
start:
format: int32
type: integer
required:
- end
- start
type: object
type: array
type: object
replicas:
default: 1
description: |-
Specifies the number of instances (Pods) to create from this InstanceTemplate.
This field allows setting how many replicated instances of the Component,
with the specific overrides in the InstanceTemplate, are created.
The default value is 1. A value of 0 disables instance creation.
format: int32
minimum: 0
type: integer
resources:
description: |-
Specifies an override for the resource requirements of the first container in the Pod.
This field allows for customizing resource allocation (CPU, memory, etc.) for the container.