Skip to content

Commit e48669f

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 e48669f

File tree

5 files changed

+104
-1
lines changed

5 files changed

+104
-1
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 33 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+
// If unset, no CPU options will be passed to the AWS platform and AWS default CPU options will be applied.
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,35 @@ 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;AmdSevSnp
118+
type AWSConfidentialComputePolicy string
119+
120+
const (
121+
// AWSConfidentialComputePolicyNone disables confidential computing for the instance.
122+
AWSConfidentialComputePolicyNone AWSConfidentialComputePolicy = "None"
123+
// AWSConfidentialComputePolicySEVSNP enables AMD SEV-SNP as the confidential computing technology for the instance.
124+
AWSConfidentialComputePolicySEVSNP AWSConfidentialComputePolicy = "AmdSevSnp"
125+
)
126+
127+
// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.
128+
// +kubebuilder:validation:MinProperties=1
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: None, AmdSev
133+
// When set to None, confidential computing will be disabled for the instance.
134+
// When set to AmdSevSnp, 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 platform is left to choose a reasonable default, which is subject to change without notice. The current default is Disabled.
141+
// +optional
142+
ConfidentialCompute AWSConfidentialComputePolicy `json:"confidentialCompute,omitempty"`
143+
}
144+
112145
// BlockDeviceMappingSpec describes a block device mapping
113146
type BlockDeviceMappingSpec struct {
114147
// 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
@@ -21953,6 +21953,11 @@
2195321953
"type": "string",
2195421954
"default": ""
2195521955
},
21956+
"cpuOptions": {
21957+
"description": "cpuOptions defines CPU-related settings for the instance, including the confidential computing policy. If unset, no CPU options will be passed to the AWS platform and AWS default CPU options will be applied.",
21958+
"default": {},
21959+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.CPUOptions"
21960+
},
2195621961
"credentialsSecret": {
2195721962
"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.",
2195821963
"$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference"
@@ -22428,6 +22433,16 @@
2242822433
}
2242922434
}
2243022435
},
22436+
"com.github.openshift.api.machine.v1beta1.CPUOptions": {
22437+
"description": "CPUOptions defines CPU-related settings for the instance, including the confidential computing policy.",
22438+
"type": "object",
22439+
"properties": {
22440+
"confidentialCompute": {
22441+
"description": "confidentialCompute specifies whether confidential computing should be enabled for the instance, and, if so, which confidential computing technology to use. Valid values are: None, AmdSev When set to None, confidential computing will be disabled for the instance. When set to AmdSevSnp, 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 platform is left to choose a reasonable default, which is subject to change without notice. The current default is Disabled.",
22442+
"type": "string"
22443+
}
22444+
}
22445+
},
2243122446
"com.github.openshift.api.machine.v1beta1.Condition": {
2243222447
"description": "Condition defines an observation of a Machine API resource operational state.",
2243322448
"type": "object",

0 commit comments

Comments
 (0)