Skip to content

Commit 1df992a

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 92b1455 commit 1df992a

File tree

5 files changed

+103
-1
lines changed

5 files changed

+103
-1
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ 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 is the set of cpu options for the instance.
21+
// +optional
22+
CPUOptions *CPUOptions `json:"cpuOptions,omitempty"`
2023
// tags is the set of tags to add to apply to an instance, in addition to the ones
2124
// added by default by the actuator. These tags are additive. The actuator will ensure
2225
// these tags are present, but will not remove any other tags that may exist on the
@@ -109,6 +112,33 @@ type AWSMachineProviderConfig struct {
109112
MarketType MarketType `json:"marketType,omitempty"`
110113
}
111114

115+
// AWSConfidentialComputePolicy represents the confidential compute configuration for the AWS machine.
116+
type AWSConfidentialComputePolicy string
117+
118+
const (
119+
// AWSConfidentialComputePolicyDisabled disables confidential compute for the AWS machine.
120+
AWSConfidentialComputePolicyDisabled AWSConfidentialComputePolicy = "Disabled"
121+
// AWSConfidentialComputePolicyAWSSEVSNP sets AMD SEV-SNP as the VM instance's confidential computing technology of choice.
122+
AWSConfidentialComputePolicySEVSNP AWSConfidentialComputePolicy = "AMDSevSnp"
123+
)
124+
125+
// CPUOptions defines the cpu options for the instance.
126+
type CPUOptions struct {
127+
// confidentialCompute specifies whether confidential computing should be enabled for the instance,
128+
// and, if so, which confidential computing technology to use.
129+
// If set to Disabled, the instance will not use confidential computing.
130+
// If set to AMDSevSnp, the instance will be configured with AMD SEV-SNP.
131+
// In this case, ensure the following conditions are met:
132+
// 1) The selected instance type supports AMD SEV-SNP.
133+
// 2) The selected AWS region supports AMD SEV-SNP.
134+
// 3) The selected AMI supports AMD SEV-SNP.
135+
// More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html
136+
// If omitted, the platform will apply a default value — currently Disabled, but this may change over time.
137+
// +kubebuilder:validation:Enum=Disabled;AMDSevSnp
138+
// +optional
139+
ConfidentialCompute AWSConfidentialComputePolicy `json:"confidentialCompute,omitempty"`
140+
}
141+
112142
// BlockDeviceMappingSpec describes a block device mapping
113143
type BlockDeviceMappingSpec struct {
114144
// The device name exposed to the machine (for example, /dev/sdh or xvdh).

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 21 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
@@ -21953,6 +21953,10 @@
2195321953
"type": "string",
2195421954
"default": ""
2195521955
},
21956+
"cpuOptions": {
21957+
"description": "cpuOptions is the set of cpu options for the instance.",
21958+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.CPUOptions"
21959+
},
2195621960
"credentialsSecret": {
2195721961
"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.",
2195821962
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
@@ -22428,6 +22432,16 @@
2242822432
}
2242922433
}
2243022434
},
22435+
"com.github.openshift.api.machine.v1beta1.CPUOptions": {
22436+
"description": "CPUOptions defines the cpu options for the instance.",
22437+
"type": "object",
22438+
"properties": {
22439+
"confidentialCompute": {
22440+
"description": "confidentialCompute specifies whether confidential computing should be enabled for the instance, and, if so, which confidential computing technology to use. If set to Disabled, the instance will not use confidential computing. If set to AMDSevSnp, the instance will be configured with AMD SEV-SNP. 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 If omitted, the platform will apply a default value — currently Disabled, but this may change over time.",
22441+
"type": "string"
22442+
}
22443+
}
22444+
},
2243122445
"com.github.openshift.api.machine.v1beta1.Condition": {
2243222446
"description": "Condition defines an observation of a Machine API resource operational state.",
2243322447
"type": "object",

0 commit comments

Comments
 (0)