Skip to content

Commit c6dbd20

Browse files
authored
Merge pull request #46035 from jeana-redhat/OSDOCS-3609-AWS-EC2-machineset-support-IMDSv2-IMDSv1
[OSDOCS-3609]: AWS machineset support for IMDS options
2 parents cf66db5 + bb8054d commit c6dbd20

File tree

4 files changed

+112
-48
lines changed

4 files changed

+112
-48
lines changed

machine_management/creating_machinesets/creating-machineset-aws.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,32 @@ toc::[]
88

99
You can create a different machine set to serve a specific purpose in your {product-title} cluster on Amazon Web Services (AWS). For example, you might create infrastructure machine sets and related machines so that you can move supporting workloads to the new machines.
1010

11+
//[IMPORTANT] admonition for UPI
1112
include::modules/machine-user-provisioned-limitations.adoc[leveloffset=+1]
1213

14+
//Machine API overview
1315
include::modules/machine-api-overview.adoc[leveloffset=+1]
1416

17+
//Sample YAML for a machine set custom resource on AWS
1518
include::modules/machineset-yaml-aws.adoc[leveloffset=+1]
1619

20+
//Creating a machine set
1721
include::modules/machineset-creating.adoc[leveloffset=+1]
1822

19-
include::modules/machineset-non-guaranteed-instance.adoc[leveloffset=+1]
23+
//Machine sets that enable the Amazon EC2 Instance Metadata Service
24+
include::modules/machineset-imds-options.adoc[leveloffset=+1]
2025

21-
include::modules/machineset-creating-non-guaranteed-instances.adoc[leveloffset=+1]
26+
//Creating machines that use the Amazon EC2 Instance Metadata Service
27+
include::modules/machineset-creating-imds-options.adoc[leveloffset=+2]
2228

29+
//Machine sets that deploy machines as Dedicated Instances
2330
include::modules/machineset-dedicated-instances.adoc[leveloffset=+1]
2431

25-
include::modules/machineset-creating-dedicated-instances.adoc[leveloffset=+1]
32+
//Creating Dedicated Instances by using machine sets
33+
include::modules/machineset-creating-dedicated-instances.adoc[leveloffset=+2]
34+
35+
//Machine sets that deploy machines as Spot Instances
36+
include::modules/machineset-non-guaranteed-instance.adoc[leveloffset=+1]
37+
38+
//Creating Spot Instances by using machine sets
39+
include::modules/machineset-creating-non-guaranteed-instances.adoc[leveloffset=+2]

modules/installation-aws-config-yaml.adoc

Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ifeval::["{context}" == "installing-restricted-networks-aws-installer-provisione
4040
:restricted:
4141
endif::[]
4242

43+
:_content-type: REFERENCE
4344
[id="installation-aws-config-yaml_{context}"]
4445
= Sample customized `install-config.yaml` file for AWS
4546

@@ -93,6 +94,8 @@ endif::gov,china,secret[]
9394
iops: 4000
9495
size: 500
9596
type: io1 <6>
97+
metadataService:
98+
authentication: Optional <7>
9699
type: m6i.xlarge
97100
replicas: 3
98101
compute: <3>
@@ -104,6 +107,8 @@ compute: <3>
104107
iops: 2000
105108
size: 500
106109
type: io1 <6>
110+
metadataService:
111+
authentication: Optional <7>
107112
type: c5.4xlarge
108113
zones:
109114
ifdef::china[]
@@ -159,94 +164,94 @@ endif::secret[]
159164
adminContact: jdoe
160165
costCenter: 7536
161166
ifdef::vpc,restricted[]
162-
subnets: <7>
167+
subnets: <8>
163168
- subnet-1
164169
- subnet-2
165170
- subnet-3
166171
ifndef::secret,china[]
167-
amiID: ami-96c6f8f7 <8>
172+
amiID: ami-96c6f8f7 <9>
168173
endif::secret,china[]
169174
ifdef::secret,china[]
170-
amiID: ami-96c6f8f7 <1> <8>
175+
amiID: ami-96c6f8f7 <1> <9>
171176
endif::secret,china[]
172-
serviceEndpoints: <9>
177+
serviceEndpoints: <10>
173178
- name: ec2
174179
ifndef::china[]
175180
url: https://vpce-id.ec2.us-west-2.vpce.amazonaws.com
176181
endif::china[]
177182
ifdef::china[]
178183
url: https://vpce-id.ec2.cn-north-1.vpce.amazonaws.com.cn
179184
endif::china[]
180-
hostedZone: Z3URY6TWQ91KVV <10>
185+
hostedZone: Z3URY6TWQ91KVV <11>
181186
endif::vpc,restricted[]
182187
ifndef::vpc,restricted[]
183-
amiID: ami-96c6f8f7 <7>
184-
serviceEndpoints: <8>
188+
amiID: ami-96c6f8f7 <8>
189+
serviceEndpoints: <9>
185190
- name: ec2
186191
url: https://vpce-id.ec2.us-west-2.vpce.amazonaws.com
187192
endif::vpc,restricted[]
188193
ifdef::vpc,restricted[]
189194
ifndef::openshift-origin[]
190-
fips: false <11>
191-
sshKey: ssh-ed25519 AAAA... <12>
195+
fips: false <12>
196+
sshKey: ssh-ed25519 AAAA... <13>
192197
endif::openshift-origin[]
193198
ifdef::openshift-origin[]
194-
sshKey: ssh-ed25519 AAAA... <11>
199+
sshKey: ssh-ed25519 AAAA... <12>
195200
endif::openshift-origin[]
196201
endif::vpc,restricted[]
197202
ifndef::vpc,restricted[]
198203
ifndef::openshift-origin[]
199-
fips: false <9>
200-
sshKey: ssh-ed25519 AAAA... <10>
204+
fips: false <10>
205+
sshKey: ssh-ed25519 AAAA... <11>
201206
endif::openshift-origin[]
202207
ifdef::openshift-origin[]
203-
sshKey: ssh-ed25519 AAAA... <9>
208+
sshKey: ssh-ed25519 AAAA... <10>
204209
endif::openshift-origin[]
205210
endif::vpc,restricted[]
206211
ifdef::private[]
207212
ifndef::openshift-origin[]
208-
publish: Internal <13>
213+
publish: Internal <14>
209214
endif::openshift-origin[]
210215
endif::private[]
211216
ifndef::restricted[]
212217
pullSecret: '{"auths": ...}' <1>
213218
endif::restricted[]
214219
ifdef::restricted[]
215220
ifndef::openshift-origin[]
216-
pullSecret: '{"auths":{"<local_registry>": {"auth": "<credentials>","email": "[email protected]"}}}' <13>
221+
pullSecret: '{"auths":{"<local_registry>": {"auth": "<credentials>","email": "[email protected]"}}}' <14>
217222
endif::openshift-origin[]
218223
ifdef::openshift-origin[]
219-
pullSecret: '{"auths":{"<local_registry>": {"auth": "<credentials>","email": "[email protected]"}}}' <12>
224+
pullSecret: '{"auths":{"<local_registry>": {"auth": "<credentials>","email": "[email protected]"}}}' <13>
220225
endif::openshift-origin[]
221226
endif::restricted[]
222227
ifdef::secret[]
223228
ifndef::openshift-origin[]
224-
additionalTrustBundle: | <14>
229+
additionalTrustBundle: | <15>
225230
-----BEGIN CERTIFICATE-----
226231
<MY_TRUSTED_CA_CERT>
227232
-----END CERTIFICATE-----
228233
endif::openshift-origin[]
229234
endif::secret[]
230235
ifdef::private[]
231236
ifdef::openshift-origin[]
232-
publish: Internal <12>
237+
publish: Internal <13>
233238
endif::openshift-origin[]
234239
endif::private[]
235240
ifdef::secret[]
236241
ifdef::openshift-origin[]
237-
additionalTrustBundle: | <13>
242+
additionalTrustBundle: | <14>
238243
-----BEGIN CERTIFICATE-----
239244
<MY_TRUSTED_CA_CERT>
240245
-----END CERTIFICATE-----
241246
endif::openshift-origin[]
242247
endif::secret[]
243248
ifdef::restricted[]
244249
ifndef::openshift-origin[]
245-
additionalTrustBundle: | <14>
250+
additionalTrustBundle: | <15>
246251
-----BEGIN CERTIFICATE-----
247252
<MY_TRUSTED_CA_CERT>
248253
-----END CERTIFICATE-----
249-
imageContentSources: <15>
254+
imageContentSources: <16>
250255
- mirrors:
251256
- <local_registry>/<local_repository_name>/release
252257
source: quay.io/openshift-release-dev/ocp-release
@@ -255,11 +260,11 @@ imageContentSources: <15>
255260
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
256261
endif::openshift-origin[]
257262
ifdef::openshift-origin[]
258-
additionalTrustBundle: | <13>
263+
additionalTrustBundle: | <14>
259264
-----BEGIN CERTIFICATE-----
260265
<MY_TRUSTED_CA_CERT>
261266
-----END CERTIFICATE-----
262-
imageContentSources: <14>
267+
imageContentSources: <15>
263268
- mirrors:
264269
- <local_registry>/<local_repository_name>/release
265270
source: quay.io/openshift-release-dev/ocp-release
@@ -303,47 +308,53 @@ disable simultaneous multithreading.
303308
====
304309
<6> To configure faster storage for etcd, especially for larger clusters, set the
305310
storage type as `io1` and set `iops` to `2000`.
311+
<7> Whether to require the link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html[Amazon EC2 Instance Metadata Service v2] (IMDSv2). To require IMDSv2, set the parameter value to `Required`. To allow the use of both IMDSv1 and IMDSv2, set the parameter value to `Optional`. If no value is specified, both IMDSv1 and IMDSv2 are allowed.
312+
+
313+
[NOTE]
314+
====
315+
The IMDS configuration for control plane machines that is set during cluster installation can only be changed by using the AWS CLI. The IMDS configuration for compute machines can be changed by using machine sets.
316+
====
306317
ifdef::vpc,restricted[]
307-
<7> If you provide your own VPC, specify subnets for each availability zone that your cluster uses.
308-
<8> The ID of the AMI used to boot machines for the cluster. If set, the AMI
318+
<8> If you provide your own VPC, specify subnets for each availability zone that your cluster uses.
319+
<9> The ID of the AMI used to boot machines for the cluster. If set, the AMI
309320
must belong to the same region as the cluster.
310-
<9> The AWS service endpoints. Custom endpoints are required when installing to
321+
<10> The AWS service endpoints. Custom endpoints are required when installing to
311322
an unknown AWS region. The endpoint URL must use the `https` protocol and the
312323
host must trust the certificate.
313-
<10> The ID of your existing Route 53 private hosted zone. Providing an existing hosted zone requires that you supply your own VPC and the hosted zone is already associated with the VPC prior to installing your cluster. If undefined, the installation program creates a new hosted zone.
324+
<11> The ID of your existing Route 53 private hosted zone. Providing an existing hosted zone requires that you supply your own VPC and the hosted zone is already associated with the VPC prior to installing your cluster. If undefined, the installation program creates a new hosted zone.
314325
ifndef::openshift-origin[]
315-
<11> Whether to enable or disable FIPS mode. By default, FIPS mode is not enabled. If FIPS mode is enabled, the {op-system-first} machines that {product-title} runs on bypass the default Kubernetes cryptography suite and use the cryptography modules that are provided with {op-system} instead.
326+
<12> Whether to enable or disable FIPS mode. By default, FIPS mode is not enabled. If FIPS mode is enabled, the {op-system-first} machines that {product-title} runs on bypass the default Kubernetes cryptography suite and use the cryptography modules that are provided with {op-system} instead.
316327
+
317328
[IMPORTANT]
318329
====
319330
The use of FIPS Validated / Modules in Process cryptographic libraries is only supported on {product-title} deployments on the `x86_64` architecture.
320331
====
321-
<12> You can optionally provide the `sshKey` value that you use to access the
332+
<13> You can optionally provide the `sshKey` value that you use to access the
322333
machines in your cluster.
323334
endif::openshift-origin[]
324335
ifdef::openshift-origin[]
325-
<11> You can optionally provide the `sshKey` value that you use to access the
336+
<12> You can optionally provide the `sshKey` value that you use to access the
326337
machines in your cluster.
327338
endif::openshift-origin[]
328339
endif::vpc,restricted[]
329340
ifndef::vpc,restricted[]
330-
<7> The ID of the AMI used to boot machines for the cluster. If set, the AMI
341+
<8> The ID of the AMI used to boot machines for the cluster. If set, the AMI
331342
must belong to the same region as the cluster.
332-
<8> The AWS service endpoints. Custom endpoints are required when installing to
343+
<9> The AWS service endpoints. Custom endpoints are required when installing to
333344
an unknown AWS region. The endpoint URL must use the `https` protocol and the
334345
host must trust the certificate.
335346
ifndef::openshift-origin[]
336-
<9> Whether to enable or disable FIPS mode. By default, FIPS mode is not enabled. If FIPS mode is enabled, the {op-system-first} machines that {product-title} runs on bypass the default Kubernetes cryptography suite and use the cryptography modules that are provided with {op-system} instead.
347+
<10> Whether to enable or disable FIPS mode. By default, FIPS mode is not enabled. If FIPS mode is enabled, the {op-system-first} machines that {product-title} runs on bypass the default Kubernetes cryptography suite and use the cryptography modules that are provided with {op-system} instead.
337348
+
338349
[IMPORTANT]
339350
====
340351
The use of FIPS Validated / Modules in Process cryptographic libraries is only supported on {product-title} deployments on the `x86_64` architecture.
341352
====
342-
<10> You can optionally provide the `sshKey` value that you use to access the
353+
<11> You can optionally provide the `sshKey` value that you use to access the
343354
machines in your cluster.
344355
endif::openshift-origin[]
345356
ifdef::openshift-origin[]
346-
<9> You can optionally provide the `sshKey` value that you use to access the
357+
<10> You can optionally provide the `sshKey` value that you use to access the
347358
machines in your cluster.
348359
endif::openshift-origin[]
349360
endif::vpc,restricted[]
@@ -354,36 +365,36 @@ For production {product-title} clusters on which you want to perform installatio
354365
====
355366
ifdef::private[]
356367
ifndef::openshift-origin[]
357-
<13> How to publish the user-facing endpoints of your cluster. Set `publish` to `Internal` to deploy a private cluster, which cannot be accessed from the internet. The default value is `External`.
368+
<14> How to publish the user-facing endpoints of your cluster. Set `publish` to `Internal` to deploy a private cluster, which cannot be accessed from the internet. The default value is `External`.
358369
endif::openshift-origin[]
359370
ifdef::openshift-origin[]
360-
<12> How to publish the user-facing endpoints of your cluster. Set `publish` to `Internal` to deploy a private cluster, which cannot be accessed from the internet. The default value is `External`.
371+
<13> How to publish the user-facing endpoints of your cluster. Set `publish` to `Internal` to deploy a private cluster, which cannot be accessed from the internet. The default value is `External`.
361372
endif::openshift-origin[]
362373
endif::private[]
363374
ifdef::secret[]
364375
ifndef::openshift-origin[]
365-
<14> The custom CA certificate. This is required when deploying to the AWS C2S Top Secret Region because the AWS API requires a custom CA trust bundle.
376+
<15> The custom CA certificate. This is required when deploying to the AWS C2S Top Secret Region because the AWS API requires a custom CA trust bundle.
366377
endif::openshift-origin[]
367378
ifdef::openshift-origin[]
368-
<13> The custom CA certificate. This is required when deploying to the AWS C2S Top Secret Region because the AWS API requires a custom CA trust bundle.
379+
<14> The custom CA certificate. This is required when deploying to the AWS C2S Top Secret Region because the AWS API requires a custom CA trust bundle.
369380
endif::openshift-origin[]
370381
endif::secret[]
371382
ifdef::restricted[]
372383
ifndef::openshift-origin[]
373-
<13> For `<local_registry>`, specify the registry domain name, and optionally the
384+
<14> For `<local_registry>`, specify the registry domain name, and optionally the
374385
port, that your mirror registry uses to serve content. For example
375386
`registry.example.com` or `registry.example.com:5000`. For `<credentials>`,
376387
specify the base64-encoded user name and password for your mirror registry.
377-
<14> Provide the contents of the certificate file that you used for your mirror registry.
378-
<15> Provide the `imageContentSources` section from the output of the command to mirror the repository.
388+
<15> Provide the contents of the certificate file that you used for your mirror registry.
389+
<16> Provide the `imageContentSources` section from the output of the command to mirror the repository.
379390
endif::openshift-origin[]
380391
ifdef::openshift-origin[]
381-
<12> For `<local_registry>`, specify the registry domain name, and optionally the
392+
<13> For `<local_registry>`, specify the registry domain name, and optionally the
382393
port, that your mirror registry uses to serve content. For example
383394
`registry.example.com` or `registry.example.com:5000`. For `<credentials>`,
384395
specify the base64-encoded user name and password for your mirror registry.
385-
<13> Provide the contents of the certificate file that you used for your mirror registry.
386-
<14> Provide the `imageContentSources` section from the output of the command to mirror the repository.
396+
<14> Provide the contents of the certificate file that you used for your mirror registry.
397+
<15> Provide the `imageContentSources` section from the output of the command to mirror the repository.
387398
endif::openshift-origin[]
388399
endif::restricted[]
389400

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/creating_machinesets/creating-machineset-aws.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="machineset-creating-imds-options_{context}"]
7+
= Configuring IMDS by using machine sets
8+
9+
You can specify whether to require the use of IMDSv2 by adding or editing the value of `metadataServiceOptions.authentication` in the machine set YAML file for your compute machines.
10+
11+
.Procedure
12+
* Add or edit the following lines under the `providerSpec` field:
13+
+
14+
[source,yaml]
15+
----
16+
providerSpec:
17+
value:
18+
metadataServiceOptions:
19+
authentication: Required <1>
20+
----
21+
<1> To require IMDSv2, set the parameter value to `Required`. To allow the use of both IMDSv1 and IMDSv2, set the parameter value to `Optional`. If no value is specified, both IMDSv1 and IMDSv2 are allowed.

modules/machineset-imds-options.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/creating_machinesets/creating-machineset-aws.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="machineset-imds-options_{context}"]
7+
= Machine set options for the Amazon EC2 Instance Metadata Service
8+
9+
You can use machine sets to create compute machines that use a specific version of the Amazon EC2 Instance Metadata Service (IMDS). Machine sets can create compute machines that allow the use of both IMDSv1 and link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html[IMDSv2] or compute machines that require the use of IMDSv2.
10+
11+
To change the IMDS configuration for existing compute machines, edit the machine set YAML file that manages those machines. To deploy new compute machines with your preferred IMDS configuration, create a machine set YAML file with the appropriate values.
12+
13+
The IMDS configuration for control plane machines is set during cluster installation. To change the control plane machine IMDS configuration, you must use the AWS CLI. For more information, see the AWS documentation about how to link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#configuring-IMDS-existing-instances[Modify instance metadata options for existing instances].
14+
15+
[IMPORTANT]
16+
====
17+
Before configuring a machine set to create compute machines that require IMDSv2, ensure that any workloads that interact with the AWS metadata service support IMDSv2.
18+
====

0 commit comments

Comments
 (0)