Skip to content

Commit e75b2fd

Browse files
authored
feat: update capa with nutanix fork (#1329)
**What problem does this PR solve?**: Updates CAPA to allow us to use nodeadm for bootstrapping. **Which issue(s) this PR fixes**: https://jira.nutanix.com/browse/NCN-110197 **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
1 parent 49ba749 commit e75b2fd

File tree

17 files changed

+773
-206
lines changed

17 files changed

+773
-206
lines changed

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachine_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ type AWSMachineSpec struct {
116116
// +kubebuilder:validation:MinLength:=2
117117
InstanceType string `json:"instanceType"`
118118

119+
// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.
120+
// When omitted, this means no opinion and the AWS platform is left to choose a reasonable default.
121+
// +optional
122+
CPUOptions CPUOptions `json:"cpuOptions,omitempty,omitzero"`
123+
119124
// AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the
120125
// AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the
121126
// AWSMachine's value takes precedence.

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/types.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ type Instance struct {
293293
// +kubebuilder:validation:Enum="";None;CapacityReservationsOnly;Open
294294
// +optional
295295
CapacityReservationPreference CapacityReservationPreference `json:"capacityReservationPreference,omitempty"`
296+
297+
// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.
298+
// When omitted, this means no opinion and the AWS platform is left to choose a reasonable default.
299+
// +optional
300+
CPUOptions CPUOptions `json:"cpuOptions,omitempty,omitzero"`
296301
}
297302

298303
// CapacityReservationPreference describes the preferred use of capacity reservations
@@ -534,3 +539,33 @@ var (
534539
// SubnetSchemaPreferPublic allocates more subnets in the VPC to public subnets.
535540
SubnetSchemaPreferPublic = SubnetSchemaType("PreferPublic")
536541
)
542+
543+
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
544+
// +kubebuilder:validation:Enum=Disabled;AMDEncryptedVirtualizationNestedPaging
545+
type AWSConfidentialComputePolicy string
546+
547+
const (
548+
// AWSConfidentialComputePolicyDisabled disables confidential computing for the instance.
549+
AWSConfidentialComputePolicyDisabled AWSConfidentialComputePolicy = "Disabled"
550+
// AWSConfidentialComputePolicySEVSNP enables AMD SEV-SNP as the confidential computing technology for the instance.
551+
AWSConfidentialComputePolicySEVSNP AWSConfidentialComputePolicy = "AMDEncryptedVirtualizationNestedPaging"
552+
)
553+
554+
// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.
555+
// +kubebuilder:validation:MinProperties=1
556+
type CPUOptions struct {
557+
// ConfidentialCompute specifies whether confidential computing should be enabled for the instance,
558+
// and, if so, which confidential computing technology to use.
559+
// Valid values are: Disabled, AMDEncryptedVirtualizationNestedPaging
560+
// When set to Disabled, confidential computing will be disabled for the instance.
561+
// When set to AMDEncryptedVirtualizationNestedPaging, AMD SEV-SNP will be used as the confidential computing technology for the instance.
562+
// In this case, ensure the following conditions are met:
563+
// 1) The selected instance type supports AMD SEV-SNP.
564+
// 2) The selected AWS region supports AMD SEV-SNP.
565+
// 3) The selected AMI supports AMD SEV-SNP.
566+
// More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html
567+
// When omitted, this means no opinion and the AWS platform is left to choose a reasonable default,
568+
// which is subject to change without notice. The current default is Disabled.
569+
// +optional
570+
ConfidentialCompute AWSConfidentialComputePolicy `json:"confidentialCompute,omitempty"`
571+
}

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go

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

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/bootstrap/eks/api/v1beta2/eksconfig_types.go

Lines changed: 0 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)