-
Notifications
You must be signed in to change notification settings - Fork 516
/
types_infrastructure.go
1912 lines (1668 loc) · 96.7 KB
/
types_infrastructure.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
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
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:subresource:status
// Infrastructure holds cluster-wide information about Infrastructure. The canonical name is `cluster`
//
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=1
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/470
// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=infrastructures,scope=Cluster
// +kubebuilder:subresource:status
// +kubebuilder:metadata:annotations=release.openshift.io/bootstrap-required=true
type Infrastructure struct {
metav1.TypeMeta `json:",inline"`
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata,omitempty"`
// spec holds user settable values for configuration
// +kubebuilder:validation:Required
// +required
Spec InfrastructureSpec `json:"spec"`
// status holds observed values from the cluster. They may not be overridden.
// +optional
Status InfrastructureStatus `json:"status"`
}
// InfrastructureSpec contains settings that apply to the cluster infrastructure.
type InfrastructureSpec struct {
// cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file.
// This configuration file is used to configure the Kubernetes cloud provider integration
// when using the built-in cloud provider integration or the external cloud controller manager.
// The namespace for this config map is openshift-config.
//
// cloudConfig should only be consumed by the kube_cloud_config controller.
// The controller is responsible for using the user configuration in the spec
// for various platforms and combining that with the user provided ConfigMap in this field
// to create a stitched kube cloud config.
// The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace
// with the kube cloud config is stored in `cloud.conf` key.
// All the clients are expected to use the generated ConfigMap only.
//
// +optional
CloudConfig ConfigMapFileReference `json:"cloudConfig"`
// platformSpec holds desired information specific to the underlying
// infrastructure provider.
PlatformSpec PlatformSpec `json:"platformSpec,omitempty"`
}
// InfrastructureStatus describes the infrastructure the cluster is leveraging.
type InfrastructureStatus struct {
// infrastructureName uniquely identifies a cluster with a human friendly name.
// Once set it should not be changed. Must be of max length 27 and must have only
// alphanumeric or hyphen characters.
InfrastructureName string `json:"infrastructureName"`
// platform is the underlying infrastructure provider for the cluster.
//
// Deprecated: Use platformStatus.type instead.
Platform PlatformType `json:"platform,omitempty"`
// platformStatus holds status information specific to the underlying
// infrastructure provider.
// +optional
PlatformStatus *PlatformStatus `json:"platformStatus,omitempty"`
// etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering
// etcd servers and clients.
// For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
// deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.
EtcdDiscoveryDomain string `json:"etcdDiscoveryDomain"`
// apiServerURL is a valid URI with scheme 'https', address and
// optionally a port (defaulting to 443). apiServerURL can be used by components like the web console
// to tell users where to find the Kubernetes API.
APIServerURL string `json:"apiServerURL"`
// apiServerInternalURL is a valid URI with scheme 'https',
// address and optionally a port (defaulting to 443). apiServerInternalURL can be used by components
// like kubelets, to contact the Kubernetes API server using the
// infrastructure provider rather than Kubernetes networking.
APIServerInternalURL string `json:"apiServerInternalURI"`
// controlPlaneTopology expresses the expectations for operands that normally run on control nodes.
// The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
// The 'SingleReplica' mode will be used in single-node deployments
// and the operators should not configure the operand for highly-available operation
// The 'External' mode indicates that the control plane is hosted externally to the cluster and that
// its components are not visible within the cluster.
// +kubebuilder:default=HighlyAvailable
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica;External
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
// infrastructureTopology expresses the expectations for infrastructure services that do not run on control
// plane nodes, usually indicated by a node selector for a `role` value
// other than `master`.
// The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
// The 'SingleReplica' mode will be used in single-node deployments
// and the operators should not configure the operand for highly-available operation
// NOTE: External topology mode is not applicable for this field.
// +kubebuilder:default=HighlyAvailable
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica
InfrastructureTopology TopologyMode `json:"infrastructureTopology"`
// cpuPartitioning expresses if CPU partitioning is a currently enabled feature in the cluster.
// CPU Partitioning means that this cluster can support partitioning workloads to specific CPU Sets.
// Valid values are "None" and "AllNodes". When omitted, the default value is "None".
// The default value of "None" indicates that no nodes will be setup with CPU partitioning.
// The "AllNodes" value indicates that all nodes have been setup with CPU partitioning,
// and can then be further configured via the PerformanceProfile API.
// +kubebuilder:default=None
// +default="None"
// +kubebuilder:validation:Enum=None;AllNodes
// +optional
CPUPartitioning CPUPartitioningMode `json:"cpuPartitioning,omitempty"`
}
// TopologyMode defines the topology mode of the control/infra nodes.
// NOTE: Enum validation is specified in each field that uses this type,
// given that External value is not applicable to the InfrastructureTopology
// field.
type TopologyMode string
const (
// "HighlyAvailable" is for operators to configure high-availability as much as possible.
HighlyAvailableTopologyMode TopologyMode = "HighlyAvailable"
// "SingleReplica" is for operators to avoid spending resources for high-availability purpose.
SingleReplicaTopologyMode TopologyMode = "SingleReplica"
// "External" indicates that the component is running externally to the cluster. When specified
// as the control plane topology, operators should avoid scheduling workloads to masters or assume
// that any of the control plane components such as kubernetes API server or etcd are visible within
// the cluster.
ExternalTopologyMode TopologyMode = "External"
)
// CPUPartitioningMode defines the mode for CPU partitioning
type CPUPartitioningMode string
const (
// CPUPartitioningNone means that no CPU Partitioning is on in this cluster infrastructure
CPUPartitioningNone CPUPartitioningMode = "None"
// CPUPartitioningAllNodes means that all nodes are configured with CPU Partitioning in this cluster
CPUPartitioningAllNodes CPUPartitioningMode = "AllNodes"
)
// PlatformLoadBalancerType defines the type of load balancer used by the cluster.
type PlatformLoadBalancerType string
const (
// LoadBalancerTypeUserManaged is a load balancer with control-plane VIPs managed outside of the cluster by the customer.
LoadBalancerTypeUserManaged PlatformLoadBalancerType = "UserManaged"
// LoadBalancerTypeOpenShiftManagedDefault is the default load balancer with control-plane VIPs managed by the OpenShift cluster.
LoadBalancerTypeOpenShiftManagedDefault PlatformLoadBalancerType = "OpenShiftManagedDefault"
)
// PlatformType is a specific supported infrastructure provider.
// +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt;EquinixMetal;PowerVS;AlibabaCloud;Nutanix;External
type PlatformType string
const (
// AWSPlatformType represents Amazon Web Services infrastructure.
AWSPlatformType PlatformType = "AWS"
// AzurePlatformType represents Microsoft Azure infrastructure.
AzurePlatformType PlatformType = "Azure"
// BareMetalPlatformType represents managed bare metal infrastructure.
BareMetalPlatformType PlatformType = "BareMetal"
// GCPPlatformType represents Google Cloud Platform infrastructure.
GCPPlatformType PlatformType = "GCP"
// LibvirtPlatformType represents libvirt infrastructure.
LibvirtPlatformType PlatformType = "Libvirt"
// OpenStackPlatformType represents OpenStack infrastructure.
OpenStackPlatformType PlatformType = "OpenStack"
// NonePlatformType means there is no infrastructure provider.
NonePlatformType PlatformType = "None"
// VSpherePlatformType represents VMWare vSphere infrastructure.
VSpherePlatformType PlatformType = "VSphere"
// OvirtPlatformType represents oVirt/RHV infrastructure.
OvirtPlatformType PlatformType = "oVirt"
// IBMCloudPlatformType represents IBM Cloud infrastructure.
IBMCloudPlatformType PlatformType = "IBMCloud"
// KubevirtPlatformType represents KubeVirt/Openshift Virtualization infrastructure.
KubevirtPlatformType PlatformType = "KubeVirt"
// EquinixMetalPlatformType represents Equinix Metal infrastructure.
EquinixMetalPlatformType PlatformType = "EquinixMetal"
// PowerVSPlatformType represents IBM Power Systems Virtual Servers infrastructure.
PowerVSPlatformType PlatformType = "PowerVS"
// AlibabaCloudPlatformType represents Alibaba Cloud infrastructure.
AlibabaCloudPlatformType PlatformType = "AlibabaCloud"
// NutanixPlatformType represents Nutanix infrastructure.
NutanixPlatformType PlatformType = "Nutanix"
// ExternalPlatformType represents generic infrastructure provider. Platform-specific components should be supplemented separately.
ExternalPlatformType PlatformType = "External"
)
// IBMCloudProviderType is a specific supported IBM Cloud provider cluster type
type IBMCloudProviderType string
const (
// Classic means that the IBM Cloud cluster is using classic infrastructure
IBMCloudProviderTypeClassic IBMCloudProviderType = "Classic"
// VPC means that the IBM Cloud cluster is using VPC infrastructure
IBMCloudProviderTypeVPC IBMCloudProviderType = "VPC"
// IBMCloudProviderTypeUPI means that the IBM Cloud cluster is using user provided infrastructure.
// This is utilized in IBM Cloud Satellite environments.
IBMCloudProviderTypeUPI IBMCloudProviderType = "UPI"
)
// DNSType indicates whether the cluster DNS is hosted by the cluster or Core DNS .
type DNSType string
const (
// ClusterHosted indicates that a DNS solution other than the default provided by the
// cloud platform is in use. In this mode, the cluster hosts a DNS solution during installation and the
// user is expected to provide their own DNS solution post-install.
// When the DNS solution is `ClusterHosted`, the cluster will continue to use the
// default Load Balancers provided by the cloud platform.
ClusterHostedDNSType DNSType = "ClusterHosted"
// PlatformDefault indicates that the cluster is using the default DNS solution for the
// cloud platform. OpenShift is responsible for all the LB and DNS configuration needed for the
// cluster to be functional with no intervention from the user. To accomplish this, OpenShift
// configures the default LB and DNS solutions provided by the underlying cloud.
PlatformDefaultDNSType DNSType = "PlatformDefault"
)
// ExternalPlatformSpec holds the desired state for the generic External infrastructure provider.
type ExternalPlatformSpec struct {
// PlatformName holds the arbitrary string representing the infrastructure provider name, expected to be set at the installation time.
// This field is solely for informational and reporting purposes and is not expected to be used for decision-making.
// +kubebuilder:default:="Unknown"
// +default="Unknown"
// +kubebuilder:validation:XValidation:rule="oldSelf == 'Unknown' || self == oldSelf",message="platform name cannot be changed once set"
// +optional
PlatformName string `json:"platformName,omitempty"`
}
// PlatformSpec holds the desired state specific to the underlying infrastructure provider
// of the current cluster. Since these are used at spec-level for the underlying cluster, it
// is supposed that only one of the spec structs is set.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install"
type PlatformSpec struct {
// type is the underlying infrastructure provider for the cluster. This
// value controls whether infrastructure automation such as service load
// balancers, dynamic volume provisioning, machine creation and deletion, and
// other integrations are enabled. If None, no infrastructure automation is
// enabled. Allowed values are "AWS", "Azure", "BareMetal", "GCP", "Libvirt",
// "OpenStack", "VSphere", "oVirt", "KubeVirt", "EquinixMetal", "PowerVS",
// "AlibabaCloud", "Nutanix" and "None". Individual components may not support all platforms,
// and must handle unrecognized platforms as None if they do not support that platform.
//
// +unionDiscriminator
Type PlatformType `json:"type"`
// AWS contains settings specific to the Amazon Web Services infrastructure provider.
// +optional
AWS *AWSPlatformSpec `json:"aws,omitempty"`
// Azure contains settings specific to the Azure infrastructure provider.
// +optional
Azure *AzurePlatformSpec `json:"azure,omitempty"`
// GCP contains settings specific to the Google Cloud Platform infrastructure provider.
// +optional
GCP *GCPPlatformSpec `json:"gcp,omitempty"`
// BareMetal contains settings specific to the BareMetal platform.
// +optional
BareMetal *BareMetalPlatformSpec `json:"baremetal,omitempty"`
// OpenStack contains settings specific to the OpenStack infrastructure provider.
// +optional
OpenStack *OpenStackPlatformSpec `json:"openstack,omitempty"`
// Ovirt contains settings specific to the oVirt infrastructure provider.
// +optional
Ovirt *OvirtPlatformSpec `json:"ovirt,omitempty"`
// VSphere contains settings specific to the VSphere infrastructure provider.
// +optional
VSphere *VSpherePlatformSpec `json:"vsphere,omitempty"`
// IBMCloud contains settings specific to the IBMCloud infrastructure provider.
// +optional
IBMCloud *IBMCloudPlatformSpec `json:"ibmcloud,omitempty"`
// Kubevirt contains settings specific to the kubevirt infrastructure provider.
// +optional
Kubevirt *KubevirtPlatformSpec `json:"kubevirt,omitempty"`
// EquinixMetal contains settings specific to the Equinix Metal infrastructure provider.
// +optional
EquinixMetal *EquinixMetalPlatformSpec `json:"equinixMetal,omitempty"`
// PowerVS contains settings specific to the IBM Power Systems Virtual Servers infrastructure provider.
// +optional
PowerVS *PowerVSPlatformSpec `json:"powervs,omitempty"`
// AlibabaCloud contains settings specific to the Alibaba Cloud infrastructure provider.
// +optional
AlibabaCloud *AlibabaCloudPlatformSpec `json:"alibabaCloud,omitempty"`
// Nutanix contains settings specific to the Nutanix infrastructure provider.
// +optional
Nutanix *NutanixPlatformSpec `json:"nutanix,omitempty"`
// ExternalPlatformType represents generic infrastructure provider.
// Platform-specific components should be supplemented separately.
// +optional
External *ExternalPlatformSpec `json:"external,omitempty"`
}
// CloudControllerManagerState defines whether Cloud Controller Manager presence is expected or not
type CloudControllerManagerState string
const (
// Cloud Controller Manager is enabled and expected to be installed.
// This value indicates that new nodes should be tainted as uninitialized when created,
// preventing them from running workloads until they are initialized by the cloud controller manager.
CloudControllerManagerExternal CloudControllerManagerState = "External"
// Cloud Controller Manager is disabled and not expected to be installed.
// This value indicates that new nodes should not be tainted
// and no extra node initialization is expected from the cloud controller manager.
CloudControllerManagerNone CloudControllerManagerState = "None"
)
// CloudControllerManagerStatus holds the state of Cloud Controller Manager (a.k.a. CCM or CPI) related settings
// +kubebuilder:validation:XValidation:rule="(has(self.state) == has(oldSelf.state)) || (!has(oldSelf.state) && self.state != \"External\")",message="state may not be added or removed once set"
type CloudControllerManagerStatus struct {
// state determines whether or not an external Cloud Controller Manager is expected to
// be installed within the cluster.
// https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
//
// Valid values are "External", "None" and omitted.
// When set to "External", new nodes will be tainted as uninitialized when created,
// preventing them from running workloads until they are initialized by the cloud controller manager.
// When omitted or set to "None", new nodes will be not tainted
// and no extra initialization from the cloud controller manager is expected.
// +kubebuilder:validation:Enum="";External;None
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="state is immutable once set"
// +optional
State CloudControllerManagerState `json:"state"`
}
// ExternalPlatformStatus holds the current status of the generic External infrastructure provider.
// +kubebuilder:validation:XValidation:rule="has(self.cloudControllerManager) == has(oldSelf.cloudControllerManager)",message="cloudControllerManager may not be added or removed once set"
type ExternalPlatformStatus struct {
// cloudControllerManager contains settings specific to the external Cloud Controller Manager (a.k.a. CCM or CPI).
// When omitted, new nodes will be not tainted
// and no extra initialization from the cloud controller manager is expected.
// +optional
CloudControllerManager CloudControllerManagerStatus `json:"cloudControllerManager"`
}
// PlatformStatus holds the current status specific to the underlying infrastructure provider
// of the current cluster. Since these are used at status-level for the underlying cluster, it
// is supposed that only one of the status structs is set.
type PlatformStatus struct {
// type is the underlying infrastructure provider for the cluster. This
// value controls whether infrastructure automation such as service load
// balancers, dynamic volume provisioning, machine creation and deletion, and
// other integrations are enabled. If None, no infrastructure automation is
// enabled. Allowed values are "AWS", "Azure", "BareMetal", "GCP", "Libvirt",
// "OpenStack", "VSphere", "oVirt", "EquinixMetal", "PowerVS", "AlibabaCloud", "Nutanix" and "None".
// Individual components may not support all platforms, and must handle
// unrecognized platforms as None if they do not support that platform.
//
// This value will be synced with to the `status.platform` and `status.platformStatus.type`.
// Currently this value cannot be changed once set.
Type PlatformType `json:"type"`
// AWS contains settings specific to the Amazon Web Services infrastructure provider.
// +optional
AWS *AWSPlatformStatus `json:"aws,omitempty"`
// Azure contains settings specific to the Azure infrastructure provider.
// +optional
Azure *AzurePlatformStatus `json:"azure,omitempty"`
// GCP contains settings specific to the Google Cloud Platform infrastructure provider.
// +optional
GCP *GCPPlatformStatus `json:"gcp,omitempty"`
// BareMetal contains settings specific to the BareMetal platform.
// +optional
BareMetal *BareMetalPlatformStatus `json:"baremetal,omitempty"`
// OpenStack contains settings specific to the OpenStack infrastructure provider.
// +optional
OpenStack *OpenStackPlatformStatus `json:"openstack,omitempty"`
// Ovirt contains settings specific to the oVirt infrastructure provider.
// +optional
Ovirt *OvirtPlatformStatus `json:"ovirt,omitempty"`
// VSphere contains settings specific to the VSphere infrastructure provider.
// +optional
VSphere *VSpherePlatformStatus `json:"vsphere,omitempty"`
// IBMCloud contains settings specific to the IBMCloud infrastructure provider.
// +optional
IBMCloud *IBMCloudPlatformStatus `json:"ibmcloud,omitempty"`
// Kubevirt contains settings specific to the kubevirt infrastructure provider.
// +optional
Kubevirt *KubevirtPlatformStatus `json:"kubevirt,omitempty"`
// EquinixMetal contains settings specific to the Equinix Metal infrastructure provider.
// +optional
EquinixMetal *EquinixMetalPlatformStatus `json:"equinixMetal,omitempty"`
// PowerVS contains settings specific to the Power Systems Virtual Servers infrastructure provider.
// +optional
PowerVS *PowerVSPlatformStatus `json:"powervs,omitempty"`
// AlibabaCloud contains settings specific to the Alibaba Cloud infrastructure provider.
// +optional
AlibabaCloud *AlibabaCloudPlatformStatus `json:"alibabaCloud,omitempty"`
// Nutanix contains settings specific to the Nutanix infrastructure provider.
// +optional
Nutanix *NutanixPlatformStatus `json:"nutanix,omitempty"`
// External contains settings specific to the generic External infrastructure provider.
// +optional
External *ExternalPlatformStatus `json:"external,omitempty"`
}
// AWSServiceEndpoint store the configuration of a custom url to
// override existing defaults of AWS Services.
type AWSServiceEndpoint struct {
// name is the name of the AWS service.
// The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
// This must be provided and cannot be empty.
//
// +kubebuilder:validation:Pattern=`^[a-z0-9-]+$`
Name string `json:"name"`
// url is fully qualified URI with scheme https, that overrides the default generated
// endpoint for a client.
// This must be provided and cannot be empty.
//
// +kubebuilder:validation:Pattern=`^https://`
URL string `json:"url"`
}
// AWSPlatformSpec holds the desired state of the Amazon Web Services infrastructure provider.
// This only includes fields that can be modified in the cluster.
type AWSPlatformSpec struct {
// serviceEndpoints list contains custom endpoints which will override default
// service endpoint of AWS Services.
// There must be only one ServiceEndpoint for a service.
// +listType=atomic
// +optional
ServiceEndpoints []AWSServiceEndpoint `json:"serviceEndpoints,omitempty"`
}
// AWSPlatformStatus holds the current status of the Amazon Web Services infrastructure provider.
type AWSPlatformStatus struct {
// region holds the default AWS region for new AWS resources created by the cluster.
Region string `json:"region"`
// ServiceEndpoints list contains custom endpoints which will override default
// service endpoint of AWS Services.
// There must be only one ServiceEndpoint for a service.
// +listType=atomic
// +optional
ServiceEndpoints []AWSServiceEndpoint `json:"serviceEndpoints,omitempty"`
// resourceTags is a list of additional tags to apply to AWS resources created for the cluster.
// See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources.
// AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags
// available for the user.
// +kubebuilder:validation:MaxItems=25
// +listType=atomic
// +optional
ResourceTags []AWSResourceTag `json:"resourceTags,omitempty"`
// cloudLoadBalancerConfig holds configuration related to DNS and cloud
// load balancers. It allows configuration of in-cluster DNS as an alternative
// to the platform default DNS implementation.
// When using the ClusterHosted DNS type, Load Balancer IP addresses
// must be provided for the API and internal API load balancers as well as the
// ingress load balancer.
//
// +default={"dnsType": "PlatformDefault"}
// +kubebuilder:default={"dnsType": "PlatformDefault"}
// +openshift:enable:FeatureGate=AWSClusterHostedDNS
// +optional
// +nullable
CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"`
}
// AWSResourceTag is a tag to apply to AWS resources created for the cluster.
type AWSResourceTag struct {
// key is the key of the tag
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:Pattern=`^[0-9A-Za-z_.:/=+-@]+$`
// +required
Key string `json:"key"`
// value is the value of the tag.
// Some AWS service do not support empty values. Since tags are added to resources in many services, the
// length of the tag value must meet the requirements of all services.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
// +kubebuilder:validation:Pattern=`^[0-9A-Za-z_.:/=+-@]+$`
// +required
Value string `json:"value"`
}
// AzurePlatformSpec holds the desired state of the Azure infrastructure provider.
// This only includes fields that can be modified in the cluster.
type AzurePlatformSpec struct{}
// AzurePlatformStatus holds the current status of the Azure infrastructure provider.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.resourceTags) && !has(self.resourceTags) || has(oldSelf.resourceTags) && has(self.resourceTags)",message="resourceTags may only be configured during installation"
type AzurePlatformStatus struct {
// resourceGroupName is the Resource Group for new Azure resources created for the cluster.
ResourceGroupName string `json:"resourceGroupName"`
// networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets used by the cluster.
// If empty, the value is same as ResourceGroupName.
// +optional
NetworkResourceGroupName string `json:"networkResourceGroupName,omitempty"`
// cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK
// with the appropriate Azure API endpoints.
// If empty, the value is equal to `AzurePublicCloud`.
// +optional
CloudName AzureCloudEnvironment `json:"cloudName,omitempty"`
// armEndpoint specifies a URL to use for resource management in non-soverign clouds such as Azure Stack.
// +optional
ARMEndpoint string `json:"armEndpoint,omitempty"`
// resourceTags is a list of additional tags to apply to Azure resources created for the cluster.
// See https://docs.microsoft.com/en-us/rest/api/resources/tags for information on tagging Azure resources.
// Due to limitations on Automation, Content Delivery Network, DNS Azure resources, a maximum of 15 tags
// may be applied. OpenShift reserves 5 tags for internal use, allowing 10 tags for user configuration.
// +kubebuilder:validation:MaxItems=10
// +kubebuilder:validation:XValidation:rule="self.all(x, x in oldSelf) && oldSelf.all(x, x in self)",message="resourceTags are immutable and may only be configured during installation"
// +listType=atomic
// +optional
ResourceTags []AzureResourceTag `json:"resourceTags,omitempty"`
}
// AzureResourceTag is a tag to apply to Azure resources created for the cluster.
type AzureResourceTag struct {
// key is the key part of the tag. A tag key can have a maximum of 128 characters and cannot be empty. Key
// must begin with a letter, end with a letter, number or underscore, and must contain only alphanumeric
// characters and the following special characters `_ . -`.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:Pattern=`^[a-zA-Z]([0-9A-Za-z_.-]*[0-9A-Za-z_])?$`
Key string `json:"key"`
// value is the value part of the tag. A tag value can have a maximum of 256 characters and cannot be empty. Value
// must contain only alphanumeric characters and the following special characters `_ + , - . / : ; < = > ? @`.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
// +kubebuilder:validation:Pattern=`^[0-9A-Za-z_.=+-@]+$`
Value string `json:"value"`
}
// AzureCloudEnvironment is the name of the Azure cloud environment
// +kubebuilder:validation:Enum="";AzurePublicCloud;AzureUSGovernmentCloud;AzureChinaCloud;AzureGermanCloud;AzureStackCloud
type AzureCloudEnvironment string
const (
// AzurePublicCloud is the general-purpose, public Azure cloud environment.
AzurePublicCloud AzureCloudEnvironment = "AzurePublicCloud"
// AzureUSGovernmentCloud is the Azure cloud environment for the US government.
AzureUSGovernmentCloud AzureCloudEnvironment = "AzureUSGovernmentCloud"
// AzureChinaCloud is the Azure cloud environment used in China.
AzureChinaCloud AzureCloudEnvironment = "AzureChinaCloud"
// AzureGermanCloud is the Azure cloud environment used in Germany.
AzureGermanCloud AzureCloudEnvironment = "AzureGermanCloud"
// AzureStackCloud is the Azure cloud environment used at the edge and on premises.
AzureStackCloud AzureCloudEnvironment = "AzureStackCloud"
)
// GCPPlatformSpec holds the desired state of the Google Cloud Platform infrastructure provider.
// This only includes fields that can be modified in the cluster.
type GCPPlatformSpec struct{}
// GCPPlatformStatus holds the current status of the Google Cloud Platform infrastructure provider.
// +openshift:validation:FeatureGateAwareXValidation:featureGate=GCPLabelsTags,rule="!has(oldSelf.resourceLabels) && !has(self.resourceLabels) || has(oldSelf.resourceLabels) && has(self.resourceLabels)",message="resourceLabels may only be configured during installation"
// +openshift:validation:FeatureGateAwareXValidation:featureGate=GCPLabelsTags,rule="!has(oldSelf.resourceTags) && !has(self.resourceTags) || has(oldSelf.resourceTags) && has(self.resourceTags)",message="resourceTags may only be configured during installation"
type GCPPlatformStatus struct {
// resourceGroupName is the Project ID for new GCP resources created for the cluster.
ProjectID string `json:"projectID"`
// region holds the region for new GCP resources created for the cluster.
Region string `json:"region"`
// resourceLabels is a list of additional labels to apply to GCP resources created for the cluster.
// See https://cloud.google.com/compute/docs/labeling-resources for information on labeling GCP resources.
// GCP supports a maximum of 64 labels per resource. OpenShift reserves 32 labels for internal use,
// allowing 32 labels for user configuration.
// +kubebuilder:validation:MaxItems=32
// +kubebuilder:validation:XValidation:rule="self.all(x, x in oldSelf) && oldSelf.all(x, x in self)",message="resourceLabels are immutable and may only be configured during installation"
// +listType=map
// +listMapKey=key
// +optional
// +openshift:enable:FeatureGate=GCPLabelsTags
ResourceLabels []GCPResourceLabel `json:"resourceLabels,omitempty"`
// resourceTags is a list of additional tags to apply to GCP resources created for the cluster.
// See https://cloud.google.com/resource-manager/docs/tags/tags-overview for information on
// tagging GCP resources. GCP supports a maximum of 50 tags per resource.
// +kubebuilder:validation:MaxItems=50
// +kubebuilder:validation:XValidation:rule="self.all(x, x in oldSelf) && oldSelf.all(x, x in self)",message="resourceTags are immutable and may only be configured during installation"
// +listType=map
// +listMapKey=key
// +optional
// +openshift:enable:FeatureGate=GCPLabelsTags
ResourceTags []GCPResourceTag `json:"resourceTags,omitempty"`
// This field was introduced and removed under tech preview.
// To avoid conflicts with serialisation, this field name may never be used again.
// Tombstone the field as a reminder.
// ClusterHostedDNS ClusterHostedDNS `json:"clusterHostedDNS,omitempty"`
// cloudLoadBalancerConfig holds configuration related to DNS and cloud
// load balancers. It allows configuration of in-cluster DNS as an alternative
// to the platform default DNS implementation.
// When using the ClusterHosted DNS type, Load Balancer IP addresses
// must be provided for the API and internal API load balancers as well as the
// ingress load balancer.
//
// +default={"dnsType": "PlatformDefault"}
// +kubebuilder:default={"dnsType": "PlatformDefault"}
// +openshift:enable:FeatureGate=GCPClusterHostedDNS
// +optional
// +nullable
CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"`
}
// GCPResourceLabel is a label to apply to GCP resources created for the cluster.
type GCPResourceLabel struct {
// key is the key part of the label. A label key can have a maximum of 63 characters and cannot be empty.
// Label key must begin with a lowercase letter, and must contain only lowercase letters, numeric characters,
// and the following special characters `_-`. Label key must not have the reserved prefixes `kubernetes-io`
// and `openshift-io`.
// +kubebuilder:validation:XValidation:rule="!self.startsWith('openshift-io') && !self.startsWith('kubernetes-io')",message="label keys must not start with either `openshift-io` or `kubernetes-io`"
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-z][0-9a-z_-]{0,62}$`
Key string `json:"key"`
// value is the value part of the label. A label value can have a maximum of 63 characters and cannot be empty.
// Value must contain only lowercase letters, numeric characters, and the following special characters `_-`.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[0-9a-z_-]{1,63}$`
Value string `json:"value"`
}
// GCPResourceTag is a tag to apply to GCP resources created for the cluster.
type GCPResourceTag struct {
// parentID is the ID of the hierarchical resource where the tags are defined,
// e.g. at the Organization or the Project level. To find the Organization or Project ID refer to the following pages:
// https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
// https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects.
// An OrganizationID must consist of decimal numbers, and cannot have leading zeroes.
// A ProjectID must be 6 to 30 characters in length, can only contain lowercase letters, numbers,
// and hyphens, and must start with a letter, and cannot end with a hyphen.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=32
// +kubebuilder:validation:Pattern=`(^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)`
ParentID string `json:"parentID"`
// key is the key part of the tag. A tag key can have a maximum of 63 characters and cannot be empty.
// Tag key must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
// alphanumeric characters, and the following special characters `._-`.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([0-9A-Za-z_.-]{0,61}[a-zA-Z0-9])?$`
Key string `json:"key"`
// value is the value part of the tag. A tag value can have a maximum of 63 characters and cannot be empty.
// Tag value must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
// alphanumeric characters, and the following special characters `_-.@%=+:,*#&(){}[]` and spaces.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([0-9A-Za-z_.@%=+:,*#&()\[\]{}\-\s]{0,61}[a-zA-Z0-9])?$`
Value string `json:"value"`
}
// CloudLoadBalancerConfig contains an union discriminator indicating the type of DNS
// solution in use within the cluster. When the DNSType is `ClusterHosted`, the cloud's
// Load Balancer configuration needs to be provided so that the DNS solution hosted
// within the cluster can be configured with those values.
// +kubebuilder:validation:XValidation:rule="has(self.dnsType) && self.dnsType != 'ClusterHosted' ? !has(self.clusterHosted) : true",message="clusterHosted is permitted only when dnsType is ClusterHosted"
// +union
type CloudLoadBalancerConfig struct {
// dnsType indicates the type of DNS solution in use within the cluster. Its default value of
// `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
// It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
// the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
// The cluster's use of the cloud's Load Balancers is unaffected by this setting.
// The value is immutable after it has been set at install time.
// Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
// Enabling this functionality allows the user to start their own DNS solution outside the cluster after
// installation is complete. The customer would be responsible for configuring this custom DNS solution,
// and it can be run in addition to the in-cluster DNS solution.
// +default="PlatformDefault"
// +kubebuilder:default:="PlatformDefault"
// +kubebuilder:validation:Enum="ClusterHosted";"PlatformDefault"
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="dnsType is immutable"
// +optional
// +unionDiscriminator
DNSType DNSType `json:"dnsType,omitempty"`
// clusterHosted holds the IP addresses of API, API-Int and Ingress Load
// Balancers on Cloud Platforms. The DNS solution hosted within the cluster
// use these IP addresses to provide resolution for API, API-Int and Ingress
// services.
// +optional
// +unionMember,optional
ClusterHosted *CloudLoadBalancerIPs `json:"clusterHosted,omitempty"`
}
// CloudLoadBalancerIPs contains the Load Balancer IPs for the cloud's API,
// API-Int and Ingress Load balancers. They will be populated as soon as the
// respective Load Balancers have been configured. These values are utilized
// to configure the DNS solution hosted within the cluster.
type CloudLoadBalancerIPs struct {
// apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
// These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
// Entries in the apiIntLoadBalancerIPs must be unique.
// A maximum of 16 IP addresses are permitted.
// +kubebuilder:validation:Format=ip
// +listType=set
// +kubebuilder:validation:MaxItems=16
// +optional
APIIntLoadBalancerIPs []IP `json:"apiIntLoadBalancerIPs,omitempty"`
// apiLoadBalancerIPs holds Load Balancer IPs for the API service.
// These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
// Could be empty for private clusters.
// Entries in the apiLoadBalancerIPs must be unique.
// A maximum of 16 IP addresses are permitted.
// +kubebuilder:validation:Format=ip
// +listType=set
// +kubebuilder:validation:MaxItems=16
// +optional
APILoadBalancerIPs []IP `json:"apiLoadBalancerIPs,omitempty"`
// ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
// These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
// Entries in the ingressLoadBalancerIPs must be unique.
// A maximum of 16 IP addresses are permitted.
// +kubebuilder:validation:Format=ip
// +listType=set
// +kubebuilder:validation:MaxItems=16
// +optional
IngressLoadBalancerIPs []IP `json:"ingressLoadBalancerIPs,omitempty"`
}
// BareMetalPlatformLoadBalancer defines the load balancer used by the cluster on BareMetal platform.
// +union
type BareMetalPlatformLoadBalancer struct {
// type defines the type of load balancer used by the cluster on BareMetal platform
// which can be a user-managed or openshift-managed load balancer
// that is to be used for the OpenShift API and Ingress endpoints.
// When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
// defined in the machine config operator will be deployed.
// When set to UserManaged these static pods will not be deployed and it is expected that
// the load balancer is configured out of band by the deployer.
// When omitted, this means no opinion and the platform is left to choose a reasonable default.
// The default value is OpenShiftManagedDefault.
// +default="OpenShiftManagedDefault"
// +kubebuilder:default:="OpenShiftManagedDefault"
// +kubebuilder:validation:Enum:="OpenShiftManagedDefault";"UserManaged"
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="type is immutable once set"
// +optional
// +unionDiscriminator
Type PlatformLoadBalancerType `json:"type,omitempty"`
}
// BareMetalPlatformSpec holds the desired state of the BareMetal infrastructure provider.
// This only includes fields that can be modified in the cluster.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
type BareMetalPlatformSpec struct {
// apiServerInternalIPs are the IP addresses to contact the Kubernetes API
// server that can be used by components inside the cluster, like kubelets
// using the infrastructure rather than Kubernetes networking. These are the
// IPs for a self-hosted load balancer in front of the API servers.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.apiServerInternalIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 && isIP(self[0]) && isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family() : true",message="apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=atomic
// +optional
APIServerInternalIPs []IP `json:"apiServerInternalIPs"`
// ingressIPs are the external IPs which route to the default ingress
// controller. The IPs are suitable targets of a wildcard DNS record used to
// resolve default route host names.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.ingressIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 && isIP(self[0]) && isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family() : true",message="ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=atomic
// +optional
IngressIPs []IP `json:"ingressIPs"`
// machineNetworks are IP networks used to connect all the OpenShift cluster
// nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
// for example "10.0.0.0/8" or "fd00::/8".
// +listType=atomic
// +kubebuilder:validation:MaxItems=32
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))"
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}
// BareMetalPlatformStatus holds the current status of the BareMetal infrastructure provider.
// For more information about the network architecture used with the BareMetal platform type, see:
// https://github.com/openshift/installer/blob/master/docs/design/baremetal/networking-infrastructure.md
type BareMetalPlatformStatus struct {
// apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
// by components inside the cluster, like kubelets using the infrastructure rather
// than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
// points to. It is the IP for a self-hosted load balancer in front of the API servers.
//
// Deprecated: Use APIServerInternalIPs instead.
APIServerInternalIP string `json:"apiServerInternalIP,omitempty"`
// apiServerInternalIPs are the IP addresses to contact the Kubernetes API
// server that can be used by components inside the cluster, like kubelets
// using the infrastructure rather than Kubernetes networking. These are the
// IPs for a self-hosted load balancer in front of the API servers. In dual
// stack clusters this list contains two IPs otherwise only one.
//
// +kubebuilder:validation:Format=ip
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="self == oldSelf || (size(self) == 2 && isIP(self[0]) && isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family() : true)",message="apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=atomic
APIServerInternalIPs []string `json:"apiServerInternalIPs"`
// ingressIP is an external IP which routes to the default ingress controller.
// The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
//
// Deprecated: Use IngressIPs instead.
IngressIP string `json:"ingressIP,omitempty"`
// ingressIPs are the external IPs which route to the default ingress
// controller. The IPs are suitable targets of a wildcard DNS record used to
// resolve default route host names. In dual stack clusters this list
// contains two IPs otherwise only one.
//
// +kubebuilder:validation:Format=ip
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="self == oldSelf || (size(self) == 2 && isIP(self[0]) && isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family() : true)",message="ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=atomic
IngressIPs []string `json:"ingressIPs"`
// nodeDNSIP is the IP address for the internal DNS used by the
// nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
// provides name resolution for the nodes themselves. There is no DNS-as-a-service for
// BareMetal deployments. In order to minimize necessary changes to the
// datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
// to the nodes in the cluster.
NodeDNSIP string `json:"nodeDNSIP,omitempty"`
// loadBalancer defines how the load balancer used by the cluster is configured.
// +default={"type": "OpenShiftManagedDefault"}
// +kubebuilder:default={"type": "OpenShiftManagedDefault"}
// +openshift:enable:FeatureGate=BareMetalLoadBalancer
// +optional
LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`
// machineNetworks are IP networks used to connect all the OpenShift cluster nodes.
// +listType=atomic
// +kubebuilder:validation:MaxItems=32
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))"
// +optional
MachineNetworks []CIDR `json:"machineNetworks"`
}
// OpenStackPlatformLoadBalancer defines the load balancer used by the cluster on OpenStack platform.
// +union
type OpenStackPlatformLoadBalancer struct {
// type defines the type of load balancer used by the cluster on OpenStack platform
// which can be a user-managed or openshift-managed load balancer
// that is to be used for the OpenShift API and Ingress endpoints.
// When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
// defined in the machine config operator will be deployed.
// When set to UserManaged these static pods will not be deployed and it is expected that
// the load balancer is configured out of band by the deployer.
// When omitted, this means no opinion and the platform is left to choose a reasonable default.
// The default value is OpenShiftManagedDefault.
// +default="OpenShiftManagedDefault"
// +kubebuilder:default:="OpenShiftManagedDefault"
// +kubebuilder:validation:Enum:="OpenShiftManagedDefault";"UserManaged"
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="type is immutable once set"
// +optional
// +unionDiscriminator
Type PlatformLoadBalancerType `json:"type,omitempty"`
}
// OpenStackPlatformSpec holds the desired state of the OpenStack infrastructure provider.
// This only includes fields that can be modified in the cluster.
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
type OpenStackPlatformSpec struct {
// apiServerInternalIPs are the IP addresses to contact the Kubernetes API
// server that can be used by components inside the cluster, like kubelets
// using the infrastructure rather than Kubernetes networking. These are the
// IPs for a self-hosted load balancer in front of the API servers.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.apiServerInternalIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 && isIP(self[0]) && isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family() : true",message="apiServerInternalIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=atomic
// +optional
APIServerInternalIPs []IP `json:"apiServerInternalIPs"`
// ingressIPs are the external IPs which route to the default ingress
// controller. The IPs are suitable targets of a wildcard DNS record used to
// resolve default route host names.
// In dual stack clusters this list contains two IP addresses, one from IPv4
// family and one from IPv6.
// In single stack clusters a single IP address is expected.
// When omitted, values from the status.ingressIPs will be used.
// Once set, the list cannot be completely removed (but its second entry can).
//
// +kubebuilder:validation:MaxItems=2
// +kubebuilder:validation:XValidation:rule="size(self) == 2 && isIP(self[0]) && isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family() : true",message="ingressIPs must contain at most one IPv4 address and at most one IPv6 address"
// +listType=atomic
// +optional
IngressIPs []IP `json:"ingressIPs"`
// machineNetworks are IP networks used to connect all the OpenShift cluster
// nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
// for example "10.0.0.0/8" or "fd00::/8".
// +listType=atomic
// +kubebuilder:validation:MaxItems=32
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))"
// +optional