Skip to content

Commit d34306b

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 d34306b

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,12 @@ 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+
// If unset, no cpuOptions will be included in the API request to AWS, and the instance will use the default CPU options
22+
// applied by AWS for the selected intance type.
23+
// +kubebuilder:validation:MinProperties=1
24+
// +optional
25+
CPUOptions CPUOptions `json:"cpuOptions,omitempty,omitzero"`
2026
// tags is the set of tags to add to apply to an instance, in addition to the ones
2127
// added by default by the actuator. These tags are additive. The actuator will ensure
2228
// these tags are present, but will not remove any other tags that may exist on the
@@ -109,6 +115,35 @@ type AWSMachineProviderConfig struct {
109115
MarketType MarketType `json:"marketType,omitempty"`
110116
}
111117

118+
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
119+
type AWSConfidentialComputePolicy string
120+
121+
const (
122+
// AWSConfidentialComputePolicyDisabled disables confidential computing for the instance.
123+
AWSConfidentialComputePolicyDisabled AWSConfidentialComputePolicy = "Disabled"
124+
// AWSConfidentialComputePolicySEVSNP enables AMD SEV-SNP as the confidential computing technology for the instance.
125+
AWSConfidentialComputePolicySEVSNP AWSConfidentialComputePolicy = "AMDEncrytedVirtualizationNestedPaging"
126+
)
127+
128+
// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.
129+
type CPUOptions struct {
130+
// confidentialCompute specifies whether confidential computing should be enabled for the instance,
131+
// and, if so, which confidential computing technology to use.
132+
// Valid values are: Disabled, AMDEncrytedVirtualizationNestedPaging
133+
// When set to Disabled, confidential computing will be disabled for the instance.
134+
// When set to AMDEncrytedVirtualizationNestedPaging, AMD SEV-SNP will be used as the confidential computing technology for the instance.
135+
// In this case, ensure the following conditions are met:
136+
// 1) The selected instance type supports AMD SEV-SNP.
137+
// 2) The selected AWS region supports AMD SEV-SNP.
138+
// 3) The selected AMI supports AMD SEV-SNP.
139+
// More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html
140+
// When omitted, this means no opinion and the AWS platform is left to choose a reasonable default,
141+
// which is subject to change without notice. The current default is Disabled.
142+
// +kubebuilder:validation:Enum=Disabled;AMDEncrytedVirtualizationNestedPaging
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. If unset, no cpuOptions will be included in the API request to AWS, and the instance will use the default CPU options applied by AWS for the selected intance type.",
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.",
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, AMDEncrytedVirtualizationNestedPaging When set to Disabled, confidential computing will be disabled for the instance. When set to AMDEncrytedVirtualizationNestedPaging, 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)