Skip to content

Commit 5eb46a7

Browse files
Merge pull request #2614 from vr4manta/SPLAT-2169
SPLAT-2169: Added AWS dedicated host support
2 parents 68ce3d9 + 9be6a09 commit 5eb46a7

File tree

5 files changed

+46
-30
lines changed

5 files changed

+46
-30
lines changed

machine/v1beta1/types_awsprovider.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ type AWSMachineProviderConfig struct {
115115
// +optional
116116
MarketType MarketType `json:"marketType,omitempty"`
117117

118+
// Tombstone: This field was moved into the Placement struct to belong w/ the Tenancy field due to involvement with the setting.
118119
// hostPlacement configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host
119120
// for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL),
120121
// and to gain visibility and control over instance placement on a physical server.
121122
// When omitted, the instance is not constrained to a dedicated host.
122123
// +openshift:enable:FeatureGate=AWSDedicatedHosts
123124
// +optional
124-
HostPlacement *HostPlacement `json:"hostPlacement,omitempty"`
125+
//HostPlacement *HostPlacement `json:"hostPlacement,omitempty"`
125126
}
126127

127128
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
@@ -294,6 +295,7 @@ type AWSResourceReference struct {
294295
}
295296

296297
// Placement indicates where to create the instance in AWS
298+
// +kubebuilder:validation:XValidation:rule="has(self.tenancy) && self.tenancy == 'host' ? true : !has(self.host)",message="host may only be specified when tenancy is host"
297299
type Placement struct {
298300
// region is the region to use to create the instance
299301
// +optional
@@ -303,8 +305,19 @@ type Placement struct {
303305
AvailabilityZone string `json:"availabilityZone,omitempty"`
304306
// tenancy indicates if instance should run on shared or single-tenant hardware. There are
305307
// supported 3 options: default, dedicated and host.
308+
// When set to default Runs on shared multi-tenant hardware.
309+
// When dedicated Runs on single-tenant hardware (any dedicated instance hardware).
310+
// When host and the host object is not provided: Runs on Dedicated Host; best-effort restart on same host.
311+
// When `host` and `host` object is provided with affinity `dedicatedHost` defined: Runs on specified Dedicated Host.
306312
// +optional
307313
Tenancy InstanceTenancy `json:"tenancy,omitempty"`
314+
// host configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host
315+
// for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL),
316+
// and to gain visibility and control over instance placement on a physical server.
317+
// When omitted, the instance is not constrained to a dedicated host.
318+
// +openshift:enable:FeatureGate=AWSDedicatedHosts
319+
// +optional
320+
Host *HostPlacement `json:"host,omitempty"`
308321
}
309322

310323
// Filter is a filter used to identify an AWS resource
@@ -416,19 +429,20 @@ const (
416429
)
417430

418431
// HostPlacement is the type that will be used to configure the placement of AWS instances.
419-
// +kubebuilder:validation:XValidation:rule="has(self.type) && self.affinity == 'DedicatedHost' ? has(self.dedicatedHost) : !has(self.dedicatedHost)",message="dedicatedHost is required when affinity is DedicatedHost, and forbidden otherwise"
432+
// +kubebuilder:validation:XValidation:rule="has(self.affinity) && self.affinity == 'DedicatedHost' ? has(self.dedicatedHost) : true",message="dedicatedHost is required when affinity is DedicatedHost, and optional otherwise"
420433
// +union
421434
type HostPlacement struct {
422435
// affinity specifies the affinity setting for the instance.
423436
// Allowed values are AnyAvailable and DedicatedHost.
424437
// When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set.
425438
// When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.
439+
// When Affinity is set to AnyAvailable and the `dedicatedHost` field is defined, it runs on specified Dedicated Host, but may move if stopped.
426440
// +required
427441
// +unionDiscriminator
428442
Affinity *HostAffinity `json:"affinity,omitempty"`
429443

430444
// dedicatedHost specifies the exact host that an instance should be restarted on if stopped.
431-
// dedicatedHost is required when 'affinity' is set to DedicatedHost, and forbidden otherwise.
445+
// dedicatedHost is required when 'affinity' is set to DedicatedHost, and optional otherwise.
432446
// +optional
433447
// +unionMember
434448
DedicatedHost *DedicatedHost `json:"dedicatedHost,omitempty"`

machine/v1beta1/zz_generated.deepcopy.go

Lines changed: 6 additions & 6 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: 4 additions & 4 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: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22141,10 +22141,6 @@
2214122141
"format": "int64",
2214222142
"default": 0
2214322143
},
22144-
"hostPlacement": {
22145-
"description": "hostPlacement configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL), and to gain visibility and control over instance placement on a physical server. When omitted, the instance is not constrained to a dedicated host.",
22146-
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.HostPlacement"
22147-
},
2214822144
"iamInstanceProfile": {
2214922145
"description": "iamInstanceProfile is a reference to an IAM role to assign to the instance",
2215022146
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.AWSResourceReference"
@@ -23232,11 +23228,11 @@
2323223228
],
2323323229
"properties": {
2323423230
"affinity": {
23235-
"description": "affinity specifies the affinity setting for the instance. Allowed values are AnyAvailable and DedicatedHost. When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set. When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.",
23231+
"description": "affinity specifies the affinity setting for the instance. Allowed values are AnyAvailable and DedicatedHost. When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set. When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host. When Affinity is set to AnyAvailable and the `dedicatedHost` field is defined, it runs on specified Dedicated Host, but may move if stopped.",
2323623232
"type": "string"
2323723233
},
2323823234
"dedicatedHost": {
23239-
"description": "dedicatedHost specifies the exact host that an instance should be restarted on if stopped. dedicatedHost is required when 'affinity' is set to DedicatedHost, and forbidden otherwise.",
23235+
"description": "dedicatedHost specifies the exact host that an instance should be restarted on if stopped. dedicatedHost is required when 'affinity' is set to DedicatedHost, and optional otherwise.",
2324023236
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.DedicatedHost"
2324123237
}
2324223238
},
@@ -24016,12 +24012,16 @@
2401624012
"description": "availabilityZone is the availability zone of the instance",
2401724013
"type": "string"
2401824014
},
24015+
"host": {
24016+
"description": "host configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL), and to gain visibility and control over instance placement on a physical server. When omitted, the instance is not constrained to a dedicated host.",
24017+
"$ref": "#/definitions/com.github.openshift.api.machine.v1beta1.HostPlacement"
24018+
},
2401924019
"region": {
2402024020
"description": "region is the region to use to create the instance",
2402124021
"type": "string"
2402224022
},
2402324023
"tenancy": {
24024-
"description": "tenancy indicates if instance should run on shared or single-tenant hardware. There are supported 3 options: default, dedicated and host.",
24024+
"description": "tenancy indicates if instance should run on shared or single-tenant hardware. There are supported 3 options: default, dedicated and host. When set to default Runs on shared multi-tenant hardware. When dedicated Runs on single-tenant hardware (any dedicated instance hardware). When host and the host object is not provided: Runs on Dedicated Host; best-effort restart on same host. When `host` and `host` object is provided with affinity `dedicatedHost` defined: Runs on specified Dedicated Host.",
2402524025
"type": "string"
2402624026
}
2402724027
}

0 commit comments

Comments
 (0)