Skip to content

Commit d9b3c14

Browse files
committed
fix: add GenericClusterConfigSpec in EKS API
1 parent 636c02e commit d9b3c14

File tree

3 files changed

+175
-25
lines changed

3 files changed

+175
-25
lines changed

api/v1alpha1/clusterconfig_types.go

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,33 @@ type NutanixClusterConfigSpec struct {
185185

186186
// +kubebuilder:object:root=true
187187

188+
// EKSClusterConfig is the Schema for the eksclusterconfigs API.
189+
type EKSClusterConfig struct {
190+
metav1.TypeMeta `json:",inline"`
191+
metav1.ObjectMeta `json:"metadata,omitempty"`
192+
193+
// +kubebuilder:validation:Optional
194+
Spec EKSClusterConfigSpec `json:"spec,omitempty"`
195+
}
196+
197+
func (s EKSClusterConfig) VariableSchema() clusterv1.VariableSchema { //nolint:gocritic,lll // Passed by value for no potential side-effect.
198+
return eksClusterConfigVariableSchema
199+
}
200+
201+
// EKSClusterConfigSpec defines the desired state of ClusterConfig.
202+
type EKSClusterConfigSpec struct {
203+
// EKS cluster configuration.
204+
// +kubebuilder:validation:Optional
205+
EKS *EKSSpec `json:"eks,omitempty"`
206+
207+
GenericClusterConfigSpec `json:",inline"`
208+
209+
// +kubebuilder:validation:Optional
210+
Addons *AWSAddons `json:"addons,omitempty"`
211+
}
212+
213+
// +kubebuilder:object:root=true
214+
188215
// KubeadmClusterConfig is the Schema for the kubeadmconfigs API.
189216
type KubeadmClusterConfig struct {
190217
metav1.TypeMeta `json:",inline"`
@@ -257,31 +284,6 @@ type GenericClusterConfigSpec struct {
257284
NTP *NTP `json:"ntp,omitempty"`
258285
}
259286

260-
// +kubebuilder:object:root=true
261-
262-
// EKSClusterConfig is the Schema for the eksclusterconfigs API.
263-
type EKSClusterConfig struct {
264-
metav1.TypeMeta `json:",inline"`
265-
metav1.ObjectMeta `json:"metadata,omitempty"`
266-
267-
// +kubebuilder:validation:Optional
268-
Spec EKSClusterConfigSpec `json:"spec,omitempty"`
269-
}
270-
271-
func (s EKSClusterConfig) VariableSchema() clusterv1.VariableSchema { //nolint:gocritic,lll // Passed by value for no potential side-effect.
272-
return eksClusterConfigVariableSchema
273-
}
274-
275-
// EKSClusterConfigSpec defines the desired state of ClusterConfig.
276-
type EKSClusterConfigSpec struct {
277-
// EKS cluster configuration.
278-
// +kubebuilder:validation:Optional
279-
EKS *EKSSpec `json:"eks,omitempty"`
280-
281-
// +kubebuilder:validation:Optional
282-
Addons *AWSAddons `json:"addons,omitempty"`
283-
}
284-
285287
type Image struct {
286288
// Repository is used to override the image repository to pull from.
287289
// +kubebuilder:validation:Optional

api/v1alpha1/crds/caren.nutanix.com_eksclusterconfigs.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,153 @@ spec:
349349
minLength: 4
350350
type: string
351351
type: object
352+
globalImageRegistryMirror:
353+
description: GlobalImageRegistryMirror sets default mirror configuration
354+
for all the image registries.
355+
properties:
356+
credentials:
357+
description: Credentials and CA certificate for the image registry
358+
mirror
359+
properties:
360+
secretRef:
361+
description: |-
362+
A reference to the Secret containing the registry credentials and optional CA certificate
363+
using the keys `username`, `password` and `ca.crt`.
364+
This credentials Secret is not required for some registries, e.g. ECR.
365+
properties:
366+
name:
367+
description: |-
368+
Name of the referent.
369+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
370+
maxLength: 253
371+
minLength: 1
372+
type: string
373+
required:
374+
- name
375+
type: object
376+
type: object
377+
url:
378+
description: Registry mirror URL.
379+
format: uri
380+
pattern: ^https?://
381+
type: string
382+
required:
383+
- url
384+
type: object
385+
imageRegistries:
386+
items:
387+
properties:
388+
credentials:
389+
description: Credentials and CA certificate for the image registry
390+
properties:
391+
secretRef:
392+
description: |-
393+
A reference to the Secret containing the registry credentials and optional CA certificate
394+
using the keys `username`, `password` and `ca.crt`.
395+
This credentials Secret is not required for some registries, e.g. ECR.
396+
properties:
397+
name:
398+
description: |-
399+
Name of the referent.
400+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
401+
maxLength: 253
402+
minLength: 1
403+
type: string
404+
required:
405+
- name
406+
type: object
407+
type: object
408+
url:
409+
description: Registry URL.
410+
format: uri
411+
pattern: ^https?://
412+
type: string
413+
required:
414+
- url
415+
type: object
416+
maxItems: 32
417+
type: array
418+
ntp:
419+
description: NTP defines the NTP configuration for the cluster.
420+
properties:
421+
servers:
422+
description: Servers is a list of NTP servers to use for time
423+
synchronization.
424+
items:
425+
maxLength: 253
426+
type: string
427+
maxItems: 16
428+
minItems: 1
429+
type: array
430+
required:
431+
- servers
432+
type: object
433+
proxy:
434+
description: HTTPProxy required for providing proxy configuration.
435+
properties:
436+
additionalNo:
437+
description: |-
438+
AdditionalNo Proxy list that will be added to the automatically calculated
439+
values that will apply no_proxy configuration for cluster internal network.
440+
Default values: localhost,127.0.0.1,<POD_NETWORK>,<SERVICE_NETWORK>,kubernetes
441+
,kubernetes.default,.svc,.svc.<SERVICE_DOMAIN>
442+
items:
443+
maxLength: 253
444+
minLength: 1
445+
type: string
446+
maxItems: 128
447+
type: array
448+
http:
449+
description: HTTP proxy value.
450+
maxLength: 2048
451+
minLength: 1
452+
type: string
453+
https:
454+
description: HTTPS proxy value.
455+
maxLength: 2048
456+
minLength: 1
457+
type: string
458+
type: object
459+
users:
460+
items:
461+
description: User defines the input for a generated user in cloud-init.
462+
properties:
463+
hashedPassword:
464+
description: |-
465+
HashedPassword is a hashed password for the user, formatted as described
466+
by the crypt(5) man page. See your distribution's documentation for
467+
instructions to create a hashed password.
468+
An empty string is not marshalled, because it is not a valid value.
469+
maxLength: 106
470+
minLength: 1
471+
type: string
472+
name:
473+
description: Name specifies the user name.
474+
maxLength: 256
475+
type: string
476+
sshAuthorizedKeys:
477+
description: |-
478+
SSHAuthorizedKeys is a list of public SSH keys to write to the
479+
machine. Use the corresponding private SSH keys to authenticate. See SSH
480+
documentation for instructions to create a key pair.
481+
items:
482+
maxLength: 256
483+
type: string
484+
maxItems: 32
485+
type: array
486+
sudo:
487+
description: |-
488+
Sudo is a sudo user specification, formatted as described in the sudo
489+
documentation.
490+
An empty string is not marshalled, because it is not a valid value.
491+
maxLength: 1024
492+
minLength: 1
493+
type: string
494+
required:
495+
- name
496+
type: object
497+
maxItems: 32
498+
type: array
352499
type: object
353500
type: object
354501
served: true

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)