3232 awsClusterConfigCRDDefinition []byte
3333 //go:embed crds/caren.nutanix.com_nutanixclusterconfigs.yaml
3434 nutanixClusterConfigCRDDefinition []byte
35+ //go:embed crds/caren.nutanix.com_kubeadmclusterconfigs.yaml
36+ kubeadmClusterConfigCRDDefinition []byte
3537 //go:embed crds/caren.nutanix.com_genericclusterconfigs.yaml
3638 genericClusterConfigCRDDefinition []byte
3739 //go:embed crds/caren.nutanix.com_eksclusterconfigs.yaml
4648 nutanixClusterConfigVariableSchema = variables .MustSchemaFromCRDYAML (
4749 nutanixClusterConfigCRDDefinition ,
4850 )
51+ kubeadmClusterConfigVariableSchema = variables .MustSchemaFromCRDYAML (
52+ kubeadmClusterConfigCRDDefinition ,
53+ )
4954 genericClusterConfigVariableSchema = variables .MustSchemaFromCRDYAML (
5055 genericClusterConfigCRDDefinition ,
5156 )
@@ -75,6 +80,7 @@ type AWSClusterConfigSpec struct {
7580 // +kubebuilder:validation:Optional
7681 AWS * AWSSpec `json:"aws,omitempty"`
7782
83+ KubeadmClusterConfigSpec `json:",inline"`
7884 GenericClusterConfigSpec `json:",inline"`
7985
8086 // +kubebuilder:validation:Optional
@@ -112,6 +118,7 @@ type DockerClusterConfigSpec struct {
112118 // +kubebuilder:validation:Optional
113119 Docker * DockerSpec `json:"docker,omitempty"`
114120
121+ KubeadmClusterConfigSpec `json:",inline"`
115122 GenericClusterConfigSpec `json:",inline"`
116123
117124 // +kubebuilder:validation:Optional
@@ -154,6 +161,7 @@ type NutanixClusterConfigSpec struct {
154161 // +kubebuilder:validation:Optional
155162 Nutanix * NutanixSpec `json:"nutanix,omitempty"`
156163
164+ KubeadmClusterConfigSpec `json:",inline"`
157165 GenericClusterConfigSpec `json:",inline"`
158166
159167 // +kubebuilder:validation:Optional
@@ -177,6 +185,44 @@ type NutanixClusterConfigSpec struct {
177185
178186// +kubebuilder:object:root=true
179187
188+ // KubeadmClusterConfig is the Schema for the kubeadmconfigs API.
189+ type KubeadmClusterConfig struct {
190+ metav1.TypeMeta `json:",inline"`
191+ metav1.ObjectMeta `json:"metadata,omitempty"`
192+
193+ // +kubebuilder:validation:Optional
194+ Spec KubeadmClusterConfigSpec `json:"spec,omitempty"`
195+ }
196+
197+ func (s KubeadmClusterConfig ) VariableSchema () clusterv1.VariableSchema { //nolint:gocritic,lll // Passed by value for no potential side-effect.
198+ return kubeadmClusterConfigVariableSchema
199+ }
200+
201+ // KubeadmConfigSpec defines configuratiion that can be set when using kubeadm to bootstrap the cluster.
202+ type KubeadmClusterConfigSpec struct {
203+ // Sets the Kubernetes image repository used for the KubeadmControlPlane.
204+ // +kubebuilder:validation:Optional
205+ // +kubebuilder:validation:Pattern=`^((?:[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*|\[(?:[a-fA-F0-9:]+)\])(:[0-9]+)?/)?[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*(/[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*)*$`
206+ // +kubebuilder:validation:MinLength=1
207+ // +kubebuilder:validation:MaxLength=2048
208+ KubernetesImageRepository string `json:"kubernetesImageRepository,omitempty"`
209+
210+ // +kubebuilder:validation:Optional
211+ Etcd * Etcd `json:"etcd,omitempty"`
212+
213+ // +kubebuilder:validation:Optional
214+ EncryptionAtRest * EncryptionAtRest `json:"encryptionAtRest,omitempty"`
215+
216+ // +kubebuilder:validation:Optional
217+ DNS * DNS `json:"dns,omitempty"`
218+
219+ // KubeProxy defines the configuration for kube-proxy.
220+ // +kubebuilder:validation:Optional
221+ KubeProxy * KubeProxy `json:"kubeProxy,omitempty"`
222+ }
223+
224+ // +kubebuilder:object:root=true
225+
180226// GenericClusterConfig is the Schema for the genericclusterconfigs API.
181227type GenericClusterConfig struct {
182228 metav1.TypeMeta `json:",inline"`
@@ -200,16 +246,6 @@ func (s GenericClusterConfig) VariableSchema() clusterv1.VariableSchema { //noli
200246
201247// GenericClusterConfigSpec defines the desired state of GenericClusterConfig.
202248type GenericClusterConfigSpec struct {
203- // Sets the Kubernetes image repository used for the KubeadmControlPlane.
204- // +kubebuilder:validation:Optional
205- // +kubebuilder:validation:Pattern=`^((?:[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*|\[(?:[a-fA-F0-9:]+)\])(:[0-9]+)?/)?[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*(/[a-z0-9]+((?:[._]|__|[-]+)[a-z0-9]+)*)*$`
206- // +kubebuilder:validation:MinLength=1
207- // +kubebuilder:validation:MaxLength=2048
208- KubernetesImageRepository string `json:"kubernetesImageRepository,omitempty"`
209-
210- // +kubebuilder:validation:Optional
211- Etcd * Etcd `json:"etcd,omitempty"`
212-
213249 // +kubebuilder:validation:Optional
214250 Proxy * HTTPProxy `json:"proxy,omitempty"`
215251
@@ -224,16 +260,6 @@ type GenericClusterConfigSpec struct {
224260 // +kubebuilder:validation:MaxItems=32
225261 Users []User `json:"users,omitempty"`
226262
227- // +kubebuilder:validation:Optional
228- EncryptionAtRest * EncryptionAtRest `json:"encryptionAtRest,omitempty"`
229-
230- // +kubebuilder:validation:Optional
231- DNS * DNS `json:"dns,omitempty"`
232-
233- // KubeProxy defines the configuration for kube-proxy.
234- // +kubebuilder:validation:Optional
235- KubeProxy * KubeProxy `json:"kubeProxy,omitempty"`
236-
237263 // NTP defines the NTP configuration for the cluster.
238264 // +kubebuilder:validation:Optional
239265 NTP * NTP `json:"ntp,omitempty"`
0 commit comments