@@ -78,6 +78,7 @@ type InitConfiguration struct {
78
78
// This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature
79
79
// +optional
80
80
// +listType=atomic
81
+ // +kubebuilder:validation:MinItems=1
81
82
// +kubebuilder:validation:MaxItems=100
82
83
BootstrapTokens []BootstrapToken `json:"bootstrapTokens,omitempty"`
83
84
@@ -101,6 +102,7 @@ type InitConfiguration struct {
101
102
// This option takes effect only on Kubernetes >=1.22.0.
102
103
// +optional
103
104
// +listType=atomic
105
+ // +kubebuilder:validation:MinItems=1
104
106
// +kubebuilder:validation:MaxItems=50
105
107
// +kubebuilder:validation:items:MinLength=1
106
108
// +kubebuilder:validation:items:MaxLength=256
@@ -202,6 +204,7 @@ type APIServer struct {
202
204
// extraVolumes is an extra set of host volumes, mounted to the control plane component.
203
205
// +optional
204
206
// +listType=atomic
207
+ // +kubebuilder:validation:MinItems=1
205
208
// +kubebuilder:validation:MaxItems=100
206
209
ExtraVolumes []HostPathMount `json:"extraVolumes,omitempty"`
207
210
@@ -210,12 +213,14 @@ type APIServer struct {
210
213
// This option takes effect only on Kubernetes >=1.31.0.
211
214
// +optional
212
215
// +listType=atomic
216
+ // +kubebuilder:validation:MinItems=1
213
217
// +kubebuilder:validation:MaxItems=100
214
218
ExtraEnvs []EnvVar `json:"extraEnvs,omitempty"`
215
219
216
220
// certSANs sets extra Subject Alternative Names for the API Server signing cert.
217
221
// +optional
218
222
// +listType=atomic
223
+ // +kubebuilder:validation:MinItems=1
219
224
// +kubebuilder:validation:MaxItems=100
220
225
// +kubebuilder:validation:items:MinLength=1
221
226
// +kubebuilder:validation:items:MaxLength=253
@@ -240,6 +245,7 @@ type ControllerManager struct {
240
245
// extraVolumes is an extra set of host volumes, mounted to the control plane component.
241
246
// +optional
242
247
// +listType=atomic
248
+ // +kubebuilder:validation:MinItems=1
243
249
// +kubebuilder:validation:MaxItems=100
244
250
ExtraVolumes []HostPathMount `json:"extraVolumes,omitempty"`
245
251
@@ -248,6 +254,7 @@ type ControllerManager struct {
248
254
// This option takes effect only on Kubernetes >=1.31.0.
249
255
// +optional
250
256
// +listType=atomic
257
+ // +kubebuilder:validation:MinItems=1
251
258
// +kubebuilder:validation:MaxItems=100
252
259
ExtraEnvs []EnvVar `json:"extraEnvs,omitempty"`
253
260
}
@@ -270,6 +277,7 @@ type Scheduler struct {
270
277
// extraVolumes is an extra set of host volumes, mounted to the control plane component.
271
278
// +optional
272
279
// +listType=atomic
280
+ // +kubebuilder:validation:MinItems=1
273
281
// +kubebuilder:validation:MaxItems=100
274
282
ExtraVolumes []HostPathMount `json:"extraVolumes,omitempty"`
275
283
@@ -278,6 +286,7 @@ type Scheduler struct {
278
286
// This option takes effect only on Kubernetes >=1.31.0.
279
287
// +optional
280
288
// +listType=atomic
289
+ // +kubebuilder:validation:MinItems=1
281
290
// +kubebuilder:validation:MaxItems=100
282
291
ExtraEnvs []EnvVar `json:"extraEnvs,omitempty"`
283
292
}
@@ -367,6 +376,7 @@ type NodeRegistrationOptions struct {
367
376
// Value 'all' ignores errors from all checks.
368
377
// +optional
369
378
// +listType=atomic
379
+ // +kubebuilder:validation:MinItems=1
370
380
// +kubebuilder:validation:MaxItems=50
371
381
// +kubebuilder:validation:items:MinLength=1
372
382
// +kubebuilder:validation:items:MaxLength=512
@@ -416,6 +426,7 @@ type BootstrapToken struct {
416
426
// for establishing bidirectional trust, but that can be changed here.
417
427
// +optional
418
428
// +listType=atomic
429
+ // +kubebuilder:validation:MinItems=1
419
430
// +kubebuilder:validation:MaxItems=100
420
431
// +kubebuilder:validation:items:MinLength=1
421
432
// +kubebuilder:validation:items:MaxLength=256
@@ -425,6 +436,7 @@ type BootstrapToken struct {
425
436
// used for authentication
426
437
// +optional
427
438
// +listType=atomic
439
+ // +kubebuilder:validation:MinItems=1
428
440
// +kubebuilder:validation:MaxItems=100
429
441
// +kubebuilder:validation:items:MinLength=1
430
442
// +kubebuilder:validation:items:MaxLength=256
@@ -446,6 +458,7 @@ type Etcd struct {
446
458
}
447
459
448
460
// LocalEtcd describes that kubeadm should run an etcd cluster locally.
461
+ // +kubebuilder:validation:MinProperties=1
449
462
type LocalEtcd struct {
450
463
// ImageMeta allows to customize the container used for etcd
451
464
ImageMeta `json:",inline"`
@@ -474,12 +487,14 @@ type LocalEtcd struct {
474
487
// This option takes effect only on Kubernetes >=1.31.0.
475
488
// +optional
476
489
// +listType=atomic
490
+ // +kubebuilder:validation:MinItems=1
477
491
// +kubebuilder:validation:MaxItems=100
478
492
ExtraEnvs []EnvVar `json:"extraEnvs,omitempty"`
479
493
480
494
// serverCertSANs sets extra Subject Alternative Names for the etcd server signing cert.
481
495
// +optional
482
496
// +listType=atomic
497
+ // +kubebuilder:validation:MinItems=1
483
498
// +kubebuilder:validation:MaxItems=100
484
499
// +kubebuilder:validation:items:MinLength=1
485
500
// +kubebuilder:validation:items:MaxLength=253
@@ -488,6 +503,7 @@ type LocalEtcd struct {
488
503
// peerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert.
489
504
// +optional
490
505
// +listType=atomic
506
+ // +kubebuilder:validation:MinItems=1
491
507
// +kubebuilder:validation:MaxItems=100
492
508
// +kubebuilder:validation:items:MinLength=1
493
509
// +kubebuilder:validation:items:MaxLength=253
@@ -560,6 +576,7 @@ type JoinConfiguration struct {
560
576
// This option takes effect only on Kubernetes >=1.22.0.
561
577
// +optional
562
578
// +listType=atomic
579
+ // +kubebuilder:validation:MinItems=1
563
580
// +kubebuilder:validation:MaxItems=50
564
581
// +kubebuilder:validation:items:MinLength=1
565
582
// +kubebuilder:validation:items:MaxLength=256
@@ -605,6 +622,7 @@ type Discovery struct {
605
622
}
606
623
607
624
// BootstrapTokenDiscovery is used to set the options for bootstrap token based discovery.
625
+ // +kubebuilder:validation:MinProperties=1
608
626
type BootstrapTokenDiscovery struct {
609
627
// token is a token used to validate cluster information
610
628
// fetched from the control-plane.
@@ -629,6 +647,7 @@ type BootstrapTokenDiscovery struct {
629
647
// openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex
630
648
// +optional
631
649
// +listType=atomic
650
+ // +kubebuilder:validation:MinItems=1
632
651
// +kubebuilder:validation:MaxItems=100
633
652
// +kubebuilder:validation:items:MinLength=1
634
653
// +kubebuilder:validation:items:MaxLength=512
@@ -678,6 +697,7 @@ type FileDiscoveryKubeConfig struct {
678
697
// KubeConfigCluster contains information about how to communicate with a kubernetes cluster.
679
698
//
680
699
// Adapted from clientcmdv1.Cluster.
700
+ // +kubebuilder:validation:MinProperties=1
681
701
type KubeConfigCluster struct {
682
702
// server is the address of the kubernetes cluster (https://hostname:port).
683
703
//
@@ -729,6 +749,7 @@ type KubeConfigCluster struct {
729
749
// Either authProvider or exec must be filled.
730
750
//
731
751
// Adapted from clientcmdv1.AuthInfo.
752
+ // +kubebuilder:validation:MinProperties=1
732
753
type KubeConfigUser struct {
733
754
// authProvider specifies a custom authentication plugin for the kubernetes cluster.
734
755
// +optional
@@ -767,6 +788,7 @@ type KubeConfigAuthExec struct {
767
788
// args is the arguments to pass to the command when executing it.
768
789
// +optional
769
790
// +listType=atomic
791
+ // +kubebuilder:validation:MinItems=1
770
792
// +kubebuilder:validation:MaxItems=100
771
793
// +kubebuilder:validation:items:MinLength=1
772
794
// +kubebuilder:validation:items:MaxLength=512
@@ -777,6 +799,7 @@ type KubeConfigAuthExec struct {
777
799
// to pass argument to the plugin.
778
800
// +optional
779
801
// +listType=atomic
802
+ // +kubebuilder:validation:MinItems=1
780
803
// +kubebuilder:validation:MaxItems=100
781
804
Env []KubeConfigAuthExecEnv `json:"env,omitempty"`
782
805
@@ -897,6 +920,7 @@ func NewBootstrapTokenString(token string) (*BootstrapTokenString, error) {
897
920
}
898
921
899
922
// Patches contains options related to applying patches to components deployed by kubeadm.
923
+ // +kubebuilder:validation:MinProperties=1
900
924
type Patches struct {
901
925
// directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
902
926
// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
@@ -935,6 +959,7 @@ type EnvVar struct {
935
959
}
936
960
937
961
// Timeouts holds various timeouts that apply to kubeadm commands.
962
+ // +kubebuilder:validation:MinProperties=1
938
963
type Timeouts struct {
939
964
// controlPlaneComponentHealthCheckSeconds is the amount of time to wait for a control plane
940
965
// component, such as the API server, to be healthy during "kubeadm init" and "kubeadm join".
0 commit comments