Skip to content

Commit 1271931

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 1271931

File tree

5 files changed

+94
-1
lines changed

5 files changed

+94
-1
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 16 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, where you can enable/disable AMD SEV-SNP on 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,19 @@ type AWSMachineProviderConfig struct {
109112
MarketType MarketType `json:"marketType,omitempty"`
110113
}
111114

115+
// CpuOptions defines the cpu options for the instance.
116+
type CpuOptions struct {
117+
// amdSevSnp enables AMD SEV-SNP on the instance.
118+
// When set to true, AMD SEV-SNP is enabled on the instance. If it is set to true:
119+
// 1) Use an instance type that supports AMD SEV-SNP.
120+
// 2) Launch your instance with supported AWS region.
121+
// 3) Use an AMI with uefi or uefi-preferred boot mode and an operating system that supports AMD SEV-SNP.
122+
// More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html
123+
// When set to false(default), AMD SEV-SNP is disabled on the instance.
124+
// +optional
125+
AmdSevSnp *bool `json:"amdSevSnp,omitempty"`
126+
}
127+
112128
// BlockDeviceMappingSpec describes a block device mapping
113129
type BlockDeviceMappingSpec struct {
114130
// 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
@@ -21953,6 +21953,10 @@
2195321953
"type": "string",
2195421954
"default": ""
2195521955
},
21956+
"cpuOptions": {
21957+
"description": "CpuOptions is the set of cpu options for the instance, where you can enable/disable AMD SEV-SNP on 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"
@@ -22479,6 +22483,16 @@
2247922483
}
2248022484
}
2248122485
},
22486+
"com.github.openshift.api.machine.v1beta1.CpuOptions": {
22487+
"description": "CpuOptions defines the cpu options for the instance.",
22488+
"type": "object",
22489+
"properties": {
22490+
"amdSevSnp": {
22491+
"description": "AmdSevSnp enables AMD SEV-SNP on the instance. When set to true, AMD SEV-SNP is enabled on the instance. If it is set to true: 1) Use an instance type that supports AMD SEV-SNP. 2) Launch your instance with supported AWS region. 3) Use an AMI with uefi or uefi-preferred boot mode and an operating system that supports AMD SEV-SNP. More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html When set to false(default), AMD SEV-SNP is disabled on the instance.",
22492+
"type": "boolean"
22493+
}
22494+
}
22495+
},
2248222496
"com.github.openshift.api.machine.v1beta1.DataDisk": {
2248322497
"description": "DataDisk specifies the parameters that are used to add one or more data disks to the machine. A Data Disk is a managed disk that's attached to a virtual machine to store application data. It differs from an OS Disk as it doesn't come with a pre-installed OS, and it cannot contain the boot volume. It is registered as SCSI drive and labeled with the chosen `lun`. e.g. for `lun: 0` the raw disk device will be available at `/dev/disk/azure/scsi1/lun0`.\n\nAs the Data Disk disk device is attached raw to the virtual machine, it will need to be partitioned, formatted with a filesystem and mounted, in order for it to be usable. This can be done by creating a custom userdata Secret with custom Ignition configuration to achieve the desired initialization. At this stage the previously defined `lun` is to be used as the \"device\" key for referencing the raw disk device to be initialized. Once the custom userdata Secret has been created, it can be referenced in the Machine's `.providerSpec.userDataSecret`. For further guidance and examples, please refer to the official OpenShift docs.",
2248422498
"type": "object",

0 commit comments

Comments
 (0)