@@ -57,19 +57,19 @@ const (
57
57
)
58
58
59
59
type Addons struct {
60
- // +optional
60
+ // +kubebuilder:validation:Optional
61
61
CNI * CNI `json:"cni,omitempty"`
62
62
63
- // +optional
63
+ // +kubebuilder:validation:Optional
64
64
NFD * NFD `json:"nfd,omitempty"`
65
65
66
- // +optional
66
+ // +kubebuilder:validation:Optional
67
67
ClusterAutoscaler * ClusterAutoscaler `json:"clusterAutoscaler,omitempty"`
68
68
69
- // +optional
69
+ // +kubebuilder:validation:Optional
70
70
CCM * CCM `json:"ccm,omitempty"`
71
71
72
- // +optional
72
+ // +kubebuilder:validation:Optional
73
73
CSIProviders * CSI `json:"csi,omitempty"`
74
74
75
75
// +optional
@@ -81,16 +81,19 @@ type AddonStrategy string
81
81
// CNI required for providing CNI configuration.
82
82
type CNI struct {
83
83
// CNI provider to deploy.
84
+ // +kubebuilder:validation:Required
84
85
// +kubebuilder:validation:Enum=Calico;Cilium
85
86
Provider string `json:"provider"`
86
87
// Addon strategy used to deploy the CNI provider to the workload cluster.
88
+ // +kubebuilder:validation:Required
87
89
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
88
90
Strategy AddonStrategy `json:"strategy"`
89
91
}
90
92
91
93
// NFD tells us to enable or disable the node feature discovery addon.
92
94
type NFD struct {
93
95
// Addon strategy used to deploy Node Feature Discovery (NFD) to the workload cluster.
96
+ // +kubebuilder:validation:Required
94
97
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
95
98
Strategy AddonStrategy `json:"strategy"`
96
99
}
@@ -99,71 +102,81 @@ type NFD struct {
99
102
type ClusterAutoscaler struct {
100
103
// Addon strategy used to deploy cluster-autoscaler to the management cluster
101
104
// targeting the workload cluster.
105
+ // +kubebuilder:validation:Required
102
106
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
103
107
Strategy AddonStrategy `json:"strategy"`
104
108
}
105
109
106
110
type DefaultStorage struct {
107
111
// Name of the CSI Provider for the default storage class.
112
+ // +kubebuilder:validation:Required
108
113
// +kubebuilder:validation:Enum=aws-ebs;nutanix
109
114
ProviderName string `json:"providerName"`
115
+
110
116
// Name of storage class config in any of the provider objects.
117
+ // +kubebuilder:validation:Required
118
+ // +kubebuilder:validation:MinLength=1
111
119
StorageClassConfigName string `json:"storageClassConfigName"`
112
120
}
113
121
114
122
type CSI struct {
115
- // +optional
123
+ // +kubebuilder:validation:Optional
116
124
Providers []CSIProvider `json:"providers,omitempty"`
117
- // +optional
125
+
126
+ // +kubebuilder:validation:Optional
118
127
DefaultStorage * DefaultStorage `json:"defaultStorage,omitempty"`
119
128
}
120
129
121
130
type CSIProvider struct {
122
131
// Name of the CSI Provider.
132
+ // +kubebuilder:validation:Required
123
133
// +kubebuilder:validation:Enum=aws-ebs;nutanix
124
134
Name string `json:"name"`
125
135
126
- // +optional
136
+ // +kubebuilder:validation:Optional
127
137
StorageClassConfig []StorageClassConfig `json:"storageClassConfig,omitempty"`
128
138
129
139
// Addon strategy used to deploy the CSI provider to the workload cluster.
140
+ // +kubebuilder:validation:Required
130
141
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
131
142
Strategy AddonStrategy `json:"strategy"`
132
143
133
144
// The reference to any secret used by the CSI Provider.
134
- // +optional
135
- Credentials * corev1. LocalObjectReference `json:"credentials,omitempty"`
145
+ // +kubebuilder:validation:Optional
146
+ Credentials * LocalObjectReference `json:"credentials,omitempty"`
136
147
}
137
148
138
149
type StorageClassConfig struct {
139
150
// Name of storage class config.
151
+ // +kubebuilder:validation:Required
152
+ // +kubebuilder:validation:MinLength=1
140
153
Name string `json:"name"`
141
154
142
155
// Parameters passed into the storage class object.
143
- // +optional
156
+ // +kubebuilder:validation:Optional
144
157
Parameters map [string ]string `json:"parameters,omitempty"`
145
158
159
+ // +kubebuilder:validation:Optional
146
160
// +kubebuilder:validation:Enum=Delete;Retain;Recycle
147
161
// +kubebuilder:default=Delete
148
- // +optional
149
- ReclaimPolicy corev1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty"`
162
+ ReclaimPolicy * corev1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty"`
150
163
151
164
// +kubebuilder:validation:Enum=Immediate;WaitForFirstConsumer
165
+ // +kubebuilder:validation:Optional
152
166
// +kubebuilder:default=WaitForFirstConsumer
153
- // +optional
154
- VolumeBindingMode storagev1.VolumeBindingMode `json:"volumeBindingMode,omitempty"`
167
+ VolumeBindingMode * storagev1.VolumeBindingMode `json:"volumeBindingMode,omitempty"`
155
168
156
169
// If the storage class should allow volume expanding
170
+ // +kubebuilder:validation:Optional
157
171
// +kubebuilder:default=false
158
- // +optional
159
172
AllowExpansion bool `json:"allowExpansion,omitempty"`
160
173
}
161
174
162
175
// CCM tells us to enable or disable the cloud provider interface.
163
176
type CCM struct {
164
177
// A reference to the Secret for credential information for the target Prism Central instance
165
- // +optional
166
- Credentials * corev1. LocalObjectReference `json:"credentials,omitempty"`
178
+ // +kubebuilder:validation:Optional
179
+ Credentials * LocalObjectReference `json:"credentials,omitempty"`
167
180
}
168
181
169
182
type ServiceLoadBalancer struct {
0 commit comments