Skip to content

Commit 7837a80

Browse files
Merge pull request #2424 from fangge1212/aws_amd_sev_snp
Support AMD SEV-SNP on AWS
2 parents 58cae3d + 5f65881 commit 7837a80

File tree

5 files changed

+116
-1
lines changed

5 files changed

+116
-1
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ type AWSMachineProviderConfig struct {
1717
AMI AWSResourceReference `json:"ami"`
1818
// instanceType is the type of instance to create. Example: m4.xlarge
1919
InstanceType string `json:"instanceType"`
20+
// cpuOptions defines CPU-related settings for the instance, including the confidential computing policy.
21+
// When omitted, this means no opinion and the AWS platform is left to choose a reasonable default.
22+
// More info:
23+
// https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CpuOptionsRequest.html,
24+
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html
25+
// +optional
26+
CPUOptions *CPUOptions `json:"cpuOptions,omitempty,omitzero"`
2027
// tags is the set of tags to add to apply to an instance, in addition to the ones
2128
// added by default by the actuator. These tags are additive. The actuator will ensure
2229
// these tags are present, but will not remove any other tags that may exist on the
@@ -109,6 +116,37 @@ type AWSMachineProviderConfig struct {
109116
MarketType MarketType `json:"marketType,omitempty"`
110117
}
111118

119+
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
120+
// +kubebuilder:validation:Enum=Disabled;AMDEncryptedVirtualizationNestedPaging
121+
type AWSConfidentialComputePolicy string
122+
123+
const (
124+
// AWSConfidentialComputePolicyDisabled disables confidential computing for the instance.
125+
AWSConfidentialComputePolicyDisabled AWSConfidentialComputePolicy = "Disabled"
126+
// AWSConfidentialComputePolicySEVSNP enables AMD SEV-SNP as the confidential computing technology for the instance.
127+
AWSConfidentialComputePolicySEVSNP AWSConfidentialComputePolicy = "AMDEncryptedVirtualizationNestedPaging"
128+
)
129+
130+
// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.
131+
// If provided, it must not be empty — at least one field must be set.
132+
// +kubebuilder:validation:MinProperties=1
133+
type CPUOptions struct {
134+
// confidentialCompute specifies whether confidential computing should be enabled for the instance,
135+
// and, if so, which confidential computing technology to use.
136+
// Valid values are: Disabled, AMDEncryptedVirtualizationNestedPaging and omitted.
137+
// When set to Disabled, confidential computing will be disabled for the instance.
138+
// When set to AMDEncryptedVirtualizationNestedPaging, AMD SEV-SNP will be used as the confidential computing technology for the instance.
139+
// In this case, ensure the following conditions are met:
140+
// 1) The selected instance type supports AMD SEV-SNP.
141+
// 2) The selected AWS region supports AMD SEV-SNP.
142+
// 3) The selected AMI supports AMD SEV-SNP.
143+
// More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html
144+
// When omitted, this means no opinion and the AWS platform is left to choose a reasonable default,
145+
// which is subject to change without notice. The current default is Disabled.
146+
// +optional
147+
ConfidentialCompute *AWSConfidentialComputePolicy `json:"confidentialCompute,omitempty"`
148+
}
149+
112150
// BlockDeviceMappingSpec describes a block device mapping
113151
type BlockDeviceMappingSpec struct {
114152
// The device name exposed to the machine (for example, /dev/sdh or xvdh).

machine/v1beta1/zz_generated.deepcopy.go

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

machine/v1beta1/zz_generated.swagger_doc_generated.go

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

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22035,6 +22035,10 @@
2203522035
"type": "string",
2203622036
"default": ""
2203722037
},
22038+
"cpuOptions": {
22039+
"description": "cpuOptions defines CPU-related settings for the instance, including the confidential computing policy. When omitted, this means no opinion and the AWS platform is left to choose a reasonable default. More info: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CpuOptionsRequest.html, https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html",
22040+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.CPUOptions"
22041+
},
2203822042
"credentialsSecret": {
2203922043
"description": "credentialsSecret is a reference to the secret with AWS credentials. Otherwise, defaults to permissions provided by attached IAM role where the actuator is running.",
2204022044
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
@@ -22510,6 +22514,16 @@
2251022514
}
2251122515
}
2251222516
},
22517+
"com.github.openshift.api.machine.v1beta1.CPUOptions": {
22518+
"description": "CPUOptions defines CPU-related settings for the instance, including the confidential computing policy. If provided, it must not be empty — at least one field must be set.",
22519+
"type": "object",
22520+
"properties": {
22521+
"confidentialCompute": {
22522+
"description": "confidentialCompute specifies whether confidential computing should be enabled for the instance, and, if so, which confidential computing technology to use. Valid values are: Disabled, AMDEncryptedVirtualizationNestedPaging and omitted. When set to Disabled, confidential computing will be disabled for the instance. When set to AMDEncryptedVirtualizationNestedPaging, AMD SEV-SNP will be used as the confidential computing technology for the instance. In this case, ensure the following conditions are met: 1) The selected instance type supports AMD SEV-SNP. 2) The selected AWS region supports AMD SEV-SNP. 3) The selected AMI supports AMD SEV-SNP. More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html When omitted, this means no opinion and the AWS platform is left to choose a reasonable default, which is subject to change without notice. The current default is Disabled.",
22523+
"type": "string"
22524+
}
22525+
}
22526+
},
2251322527
"com.github.openshift.api.machine.v1beta1.Condition": {
2251422528
"description": "Condition defines an observation of a Machine API resource operational state.",
2251522529
"type": "object",

0 commit comments

Comments
 (0)