Skip to content

Commit b3c053b

Browse files
k8s-ci-robotvigneshb027
authored andcommitted
Merge pull request kubernetes-sigs#5700 from nutanix-cloud-native/faiq/nodeadm-upstream
✨ Implement nodeadm bootstrapping type
1 parent dcfaef0 commit b3c053b

36 files changed

Lines changed: 3762 additions & 246 deletions

.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@ linters:
323323
- linters:
324324
- goconst
325325
path: (.+)_test\.go
326+
- linters:
327+
- staticcheck
328+
text: 'SA1019: "sigs.k8s.io/cluster-api/(.*)" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped.'
329+
- linters:
330+
- staticcheck
331+
text: "s.scope.ControlPlaneLoadBalancer is deprecated"
332+
- linters:
333+
- staticcheck
334+
path: bootstrap/eks/
335+
text: 'SA1019: (.*)EKSConfig is deprecated'
326336
paths:
327337
- third_party$
328338
- builtin$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ test-e2e: $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) generate-test-flavors e2e-image ##
451451

452452
.PHONY: test-e2e-eks ## Run EKS e2e tests using clusterctl
453453
test-e2e-eks: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
454-
time go run github.com/onsi/ginkgo/v2/ginkgo -tags=e2e $(GINKGO_ARGS) ./test/e2e/suites/managed/... -- -config-path="$(E2E_EKS_CONF_PATH)" --source-template="$(EKS_SOURCE_TEMPLATE)" $(E2E_ARGS) $(EKS_E2E_ARGS)
454+
time go run github.com/onsi/ginkgo/v2/ginkgo -tags=e2e $(GINKGO_ARGS) -nodes 2 ./test/e2e/suites/managed/... -- -config-path="$(E2E_EKS_CONF_PATH)" --source-template="$(EKS_SOURCE_TEMPLATE)" $(E2E_ARGS) $(EKS_E2E_ARGS)
455455

456456
CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
457457
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)

bootstrap/eks/PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ resources:
1515
- group: bootstrap
1616
kind: EKSConfigTemplate
1717
version: v1beta2
18-
version: "2"
18+
version: "3"

bootstrap/eks/api/v1beta2/eksconfig_types.go

Lines changed: 5 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Kubernetes Authors.
2+
Copyright 2026 The Kubernetes Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -110,203 +110,6 @@ type EKSConfigStatus struct {
110110
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
111111
}
112112

113-
// Encoding specifies the cloud-init file encoding.
114-
// +kubebuilder:validation:Enum=base64;gzip;gzip+base64
115-
type Encoding string
116-
117-
const (
118-
// Base64 implies the contents of the file are encoded as base64.
119-
Base64 Encoding = "base64"
120-
// Gzip implies the contents of the file are encoded with gzip.
121-
Gzip Encoding = "gzip"
122-
// GzipBase64 implies the contents of the file are first base64 encoded and then gzip encoded.
123-
GzipBase64 Encoding = "gzip+base64"
124-
)
125-
126-
// File defines the input for generating write_files in cloud-init.
127-
type File struct {
128-
// Path specifies the full path on disk where to store the file.
129-
Path string `json:"path"`
130-
131-
// Owner specifies the ownership of the file, e.g. "root:root".
132-
// +optional
133-
Owner string `json:"owner,omitempty"`
134-
135-
// Permissions specifies the permissions to assign to the file, e.g. "0640".
136-
// +optional
137-
Permissions string `json:"permissions,omitempty"`
138-
139-
// Encoding specifies the encoding of the file contents.
140-
// +optional
141-
Encoding Encoding `json:"encoding,omitempty"`
142-
143-
// Append specifies whether to append Content to existing file if Path exists.
144-
// +optional
145-
Append bool `json:"append,omitempty"`
146-
147-
// Content is the actual content of the file.
148-
// +optional
149-
Content string `json:"content,omitempty"`
150-
151-
// ContentFrom is a referenced source of content to populate the file.
152-
// +optional
153-
ContentFrom *FileSource `json:"contentFrom,omitempty"`
154-
}
155-
156-
// FileSource is a union of all possible external source types for file data.
157-
// Only one field may be populated in any given instance. Developers adding new
158-
// sources of data for target systems should add them here.
159-
type FileSource struct {
160-
// Secret represents a secret that should populate this file.
161-
Secret SecretFileSource `json:"secret"`
162-
}
163-
164-
// SecretFileSource adapts a Secret into a FileSource.
165-
//
166-
// The contents of the target Secret's Data field will be presented
167-
// as files using the keys in the Data field as the file names.
168-
type SecretFileSource struct {
169-
// Name of the secret in the KubeadmBootstrapConfig's namespace to use.
170-
Name string `json:"name"`
171-
172-
// Key is the key in the secret's data map for this value.
173-
Key string `json:"key"`
174-
}
175-
176-
// PasswdSource is a union of all possible external source types for passwd data.
177-
// Only one field may be populated in any given instance. Developers adding new
178-
// sources of data for target systems should add them here.
179-
type PasswdSource struct {
180-
// Secret represents a secret that should populate this password.
181-
Secret SecretPasswdSource `json:"secret"`
182-
}
183-
184-
// SecretPasswdSource adapts a Secret into a PasswdSource.
185-
//
186-
// The contents of the target Secret's Data field will be presented
187-
// as passwd using the keys in the Data field as the file names.
188-
type SecretPasswdSource struct {
189-
// Name of the secret in the KubeadmBootstrapConfig's namespace to use.
190-
Name string `json:"name"`
191-
192-
// Key is the key in the secret's data map for this value.
193-
Key string `json:"key"`
194-
}
195-
196-
// User defines the input for a generated user in cloud-init.
197-
type User struct {
198-
// Name specifies the username
199-
Name string `json:"name"`
200-
201-
// Gecos specifies the gecos to use for the user
202-
// +optional
203-
Gecos *string `json:"gecos,omitempty"`
204-
205-
// Groups specifies the additional groups for the user
206-
// +optional
207-
Groups *string `json:"groups,omitempty"`
208-
209-
// HomeDir specifies the home directory to use for the user
210-
// +optional
211-
HomeDir *string `json:"homeDir,omitempty"`
212-
213-
// Inactive specifies whether to mark the user as inactive
214-
// +optional
215-
Inactive *bool `json:"inactive,omitempty"`
216-
217-
// Shell specifies the user's shell
218-
// +optional
219-
Shell *string `json:"shell,omitempty"`
220-
221-
// Passwd specifies a hashed password for the user
222-
// +optional
223-
Passwd *string `json:"passwd,omitempty"`
224-
225-
// PasswdFrom is a referenced source of passwd to populate the passwd.
226-
// +optional
227-
PasswdFrom *PasswdSource `json:"passwdFrom,omitempty"`
228-
229-
// PrimaryGroup specifies the primary group for the user
230-
// +optional
231-
PrimaryGroup *string `json:"primaryGroup,omitempty"`
232-
233-
// LockPassword specifies if password login should be disabled
234-
// +optional
235-
LockPassword *bool `json:"lockPassword,omitempty"`
236-
237-
// Sudo specifies a sudo role for the user
238-
// +optional
239-
Sudo *string `json:"sudo,omitempty"`
240-
241-
// SSHAuthorizedKeys specifies a list of ssh authorized keys for the user
242-
// +optional
243-
SSHAuthorizedKeys []string `json:"sshAuthorizedKeys,omitempty"`
244-
}
245-
246-
// NTP defines input for generated ntp in cloud-init.
247-
type NTP struct {
248-
// Servers specifies which NTP servers to use
249-
// +optional
250-
Servers []string `json:"servers,omitempty"`
251-
252-
// Enabled specifies whether NTP should be enabled
253-
// +optional
254-
Enabled *bool `json:"enabled,omitempty"`
255-
}
256-
257-
// DiskSetup defines input for generated disk_setup and fs_setup in cloud-init.
258-
type DiskSetup struct {
259-
// Partitions specifies the list of the partitions to setup.
260-
// +optional
261-
Partitions []Partition `json:"partitions,omitempty"`
262-
263-
// Filesystems specifies the list of file systems to setup.
264-
// +optional
265-
Filesystems []Filesystem `json:"filesystems,omitempty"`
266-
}
267-
268-
// Partition defines how to create and layout a partition.
269-
type Partition struct {
270-
// Device is the name of the device.
271-
Device string `json:"device"`
272-
// Layout specifies the device layout.
273-
// If it is true, a single partition will be created for the entire device.
274-
// When layout is false, it means don't partition or ignore existing partitioning.
275-
Layout bool `json:"layout"`
276-
// Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device.
277-
// Use with caution. Default is 'false'.
278-
// +optional
279-
Overwrite *bool `json:"overwrite,omitempty"`
280-
// TableType specifies the tupe of partition table. The following are supported:
281-
// 'mbr': default and setups a MS-DOS partition table
282-
// 'gpt': setups a GPT partition table
283-
// +optional
284-
TableType *string `json:"tableType,omitempty"`
285-
}
286-
287-
// Filesystem defines the file systems to be created.
288-
type Filesystem struct {
289-
// Device specifies the device name
290-
Device string `json:"device"`
291-
// Filesystem specifies the file system type.
292-
Filesystem string `json:"filesystem"`
293-
// Label specifies the file system label to be used. If set to None, no label is used.
294-
Label string `json:"label"`
295-
// Partition specifies the partition to use. The valid options are: "auto|any", "auto", "any", "none", and <NUM>, where NUM is the actual partition number.
296-
// +optional
297-
Partition *string `json:"partition,omitempty"`
298-
// Overwrite defines whether or not to overwrite any existing filesystem.
299-
// If true, any pre-existing file system will be destroyed. Use with Caution.
300-
// +optional
301-
Overwrite *bool `json:"overwrite,omitempty"`
302-
// ExtraOpts defined extra options to add to the command for creating the file system.
303-
// +optional
304-
ExtraOpts []string `json:"extraOpts,omitempty"`
305-
}
306-
307-
// MountPoints defines input for generated mounts in cloud-init.
308-
type MountPoints []string
309-
310113
// +kubebuilder:object:root=true
311114
// +kubebuilder:resource:path=eksconfigs,scope=Namespaced,categories=cluster-api,shortName=eksc
312115
// +kubebuilder:storageversion
@@ -315,6 +118,10 @@ type MountPoints []string
315118
// +kubebuilder:printcolumn:name="DataSecretName",type="string",JSONPath=".status.dataSecretName",description="Name of Secret containing bootstrap data"
316119

317120
// EKSConfig is the schema for the Amazon EKS Machine Bootstrap Configuration API.
121+
//
122+
// Deprecated: EKSConfig is deprecated and will be removed in a future release.
123+
// Amazon Linux 2 (AL2) reaches end-of-life in June 2026 see: https://aws.amazon.com/amazon-linux-2/faqs/
124+
// Please use NodeadmConfig with Amazon Linux 2023 (AL2023) instead.
318125
type EKSConfig struct {
319126
metav1.TypeMeta `json:",inline"`
320127
metav1.ObjectMeta `json:"metadata,omitempty"`

0 commit comments

Comments
 (0)