Skip to content

Commit 5534fd1

Browse files
committed
Support AMD SEV-SNP on AWS
AMD SEV-SNP is one of the confidential computing technologies. This commit adds support for AMD SEV-SNP on AWS, so users can utilize the confidential computing on the cluster nodes. Signed-off-by: Fangge Jin <[email protected]>
1 parent 213cdac commit 5534fd1

File tree

5 files changed

+106
-1
lines changed

5 files changed

+106
-1
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ 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+
// +optional
23+
CPUOptions CPUOptions `json:"cpuOptions,omitempty,omitzero"`
2024
// tags is the set of tags to add to apply to an instance, in addition to the ones
2125
// added by default by the actuator. These tags are additive. The actuator will ensure
2226
// these tags are present, but will not remove any other tags that may exist on the
@@ -109,6 +113,37 @@ type AWSMachineProviderConfig struct {
109113
MarketType MarketType `json:"marketType,omitempty"`
110114
}
111115

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

machine/v1beta1/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.

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: 29 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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21960,6 +21960,11 @@
2196021960
"type": "string",
2196121961
"default": ""
2196221962
},
21963+
"cpuOptions": {
21964+
"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.",
21965+
"default": {},
21966+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.CPUOptions"
21967+
},
2196321968
"credentialsSecret": {
2196421969
"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.",
2196521970
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
@@ -22435,6 +22440,16 @@
2243522440
}
2243622441
}
2243722442
},
22443+
"com.github.openshift.api.machine.v1beta1.CPUOptions": {
22444+
"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.",
22445+
"type": "object",
22446+
"properties": {
22447+
"confidentialCompute": {
22448+
"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.",
22449+
"type": "string"
22450+
}
22451+
}
22452+
},
2243822453
"com.github.openshift.api.machine.v1beta1.Condition": {
2243922454
"description": "Condition defines an observation of a Machine API resource operational state.",
2244022455
"type": "object",

0 commit comments

Comments
 (0)