Skip to content

Commit 0e59e16

Browse files
authored
Merge pull request #40954 from jldohmann/OSDOCS-3143
OSDOCS-3143: Add coreos-installer iso customize feature
2 parents 4bb5f79 + b071662 commit 0e59e16

10 files changed

+243
-83
lines changed

installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ include::modules/installation-user-infra-machines-pxe.adoc[leveloffset=+2]
111111

112112
include::modules/installation-user-infra-machines-advanced.adoc[leveloffset=+2]
113113

114+
include::modules/installation-user-infra-machines-advanced-customizing-iso-or-pxe.adoc[leveloffset=+4]
115+
116+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc[leveloffset=+4]
117+
118+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc[leveloffset=+5]
119+
120+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc[leveloffset=+5]
121+
114122
include::modules/installation-user-infra-machines-static-network.adoc[leveloffset=+3]
115123

116124
include::modules/rhcos-enabling-multipath.adoc[leveloffset=+2]

installing/installing_bare_metal/installing-bare-metal.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ include::modules/installation-user-infra-machines-pxe.adoc[leveloffset=+2]
124124

125125
include::modules/installation-user-infra-machines-advanced.adoc[leveloffset=+2]
126126

127+
include::modules/installation-user-infra-machines-advanced-customizing-iso-or-pxe.adoc[leveloffset=+4]
128+
129+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc[leveloffset=+4]
130+
131+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc[leveloffset=+5]
132+
133+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc[leveloffset=+5]
134+
127135
include::modules/installation-user-infra-machines-static-network.adoc[leveloffset=+3]
128136

129137
include::modules/rhcos-enabling-multipath.adoc[leveloffset=+2]

installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ include::modules/installation-user-infra-machines-pxe.adoc[leveloffset=+2]
131131

132132
include::modules/installation-user-infra-machines-advanced.adoc[leveloffset=+2]
133133

134+
include::modules/installation-user-infra-machines-advanced-customizing-iso-or-pxe.adoc[leveloffset=+4]
135+
136+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc[leveloffset=+4]
137+
138+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc[leveloffset=+5]
139+
140+
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc[leveloffset=+5]
141+
134142
include::modules/installation-user-infra-machines-static-network.adoc[leveloffset=+3]
135143

136144
include::modules/rhcos-enabling-multipath.adoc[leveloffset=+2]

modules/installation-special-config-storage.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ When the `Do you wish to trust these keys? [ynYN]` prompt displays, type `Y`.
155155
{op-system-base} 8 provides Clevis version 15, which uses the SHA-1 hash algorithm to generate thumbprints. Some other distributions provide Clevis version 17 or later, which use the SHA-256 hash algorithm for thumbprints. You must use a Clevis version that uses SHA-1 to create the thumbprint, to prevent Clevis binding issues when you install {op-system-first} on your {product-title} cluster nodes.
156156
====
157157

158-
.. If the nodes are configured with static IP addressing, use the `coreos-installer` `--append-karg` option when installing {op-system} nodes to set the IP address of the installed system. Append the `ip=` and other arguments needed for your network.
158+
.. If the nodes are configured with static IP addressing, run `coreos-installer iso customize --dest-karg-append` or use the `coreos-installer` `--append-karg` option when installing {op-system} nodes to set the IP address of the installed system. Append the `ip=` and other arguments needed for your network.
159159
+
160160
[IMPORTANT]
161161
====
162-
Some methods for configuring static IPs do not affect the initramfs after the first boot and will not work with Tang encryption. These include the `coreos-installer` `--copy-network` option, as well as adding `ip=` arguments to the kernel command line of the live ISO or PXE image during installation. Incorrect static IP configuration causes the second boot of the node to fail.
162+
Some methods for configuring static IPs do not affect the initramfs after the first boot and will not work with Tang encryption. These include the `coreos-installer` `--copy-network` option, the `coreos-installer iso customize` `--network-keyfile` option, and the `coreos-installer pxe customize` `--network-keyfile` option, as well as adding `ip=` arguments to the kernel command line of the live ISO or PXE image during installation. Incorrect static IP configuration causes the second boot of the node to fail.
163163
====
164164

165165
. On your installation node, change to the directory that contains the installation program and generate the Kubernetes manifests for the cluster:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Module included in the following assemblies
2+
//
3+
// * installing/installing_bare_metal/installing-bare-metal.adoc
4+
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
5+
// * installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc
6+
7+
[id="installation-user-infra-machines-advanced-customizing-iso-or-pxe_{context}"]
8+
= Customizing a live {op-system} ISO or PXE install
9+
You can use the live ISO image or PXE environment to install {op-system} by injecting an Ignition config file directly into the image. This creates a customized image that you can use to provision your system.
10+
11+
For an ISO image, the mechanism to do this is the `coreos-installer iso customize` subcommand, which modifies the `.iso` file with your configuration. Similarly, the mechanism for a PXE environment is the `coreos-installer pxe customize` subcommand, which creates a new `initramfs` file that includes your customizations.
12+
13+
The `customize` subcommand is a general purpose tool that can embed other types of customizations as well. The following tasks are examples of some of the more common customizations:
14+
15+
* Inject custom CA certificates for when corporate security policy requires their use.
16+
* Configure network settings without the need for kernel arguments.
17+
* Embed arbitrary pre-install and post-install scripts or binaries.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Module included in the following assemblies
2+
//
3+
// * installing/installing_bare_metal/installing-bare-metal.adoc
4+
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
5+
// * installing_bare_metal/installing-bare-metal-network-customizations.adoc
6+
7+
[id="installation-user-infra-machines-advanced-customizing-live-iso-ca-certs_{context}"]
8+
= Modifying a live install image to use a custom certificate authority
9+
10+
You can provide certificate authority (CA) certificates to Ignition with the `--ignition-ca` flag of the `customize` subcommand. You can use the CA certificates during both the installation boot and when provisioning the installed system.
11+
12+
.Procedure
13+
14+
. Download the `coreos-installer` binary from the link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[`coreos-installer` image mirror] page.
15+
16+
. Retrieve the {op-system} ISO image from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and run the following command to customize the ISO image for use with a custom CA:
17+
+
18+
[source,terminal]
19+
----
20+
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso --ignition-ca cert.pem
21+
----
22+
+
23+
[NOTE]
24+
====
25+
Custom CA certificates affect how Ignition fetches remote resources but they do not affect the certificates installed onto the system.
26+
====
27+
+
28+
Your CA certificate is applied and affects every subsequent boot of the ISO image.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Module included in the following assemblies
2+
//
3+
// * installing/installing_bare_metal/installing-bare-metal.adoc
4+
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
5+
// * installing_bare_metal/installing-bare-metal-network-customizations.adoc
6+
7+
[id="installation-user-infra-machines-advanced-customizing-live-iso_network_keyfile_{context}"]
8+
= Modifying a live install image with customized network settings
9+
You can embed a NetworkManager keyfile into the live ISO image and pass it through to the installed system with the `--network-keyfile` flag of the `customize` subcommand.
10+
11+
.Procedure
12+
13+
. Download the `coreos-installer` binary from the link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[`coreos-installer` image mirror] page.
14+
15+
. Create a connection profile for a bonded interface. For example, create the `bond0.nmconnection` file in your local directory with the following content:
16+
+
17+
[source,ini]
18+
----
19+
[connection]
20+
id=bond0
21+
type=bond
22+
interface-name=bond0
23+
multi-connect=1
24+
permissions=
25+
26+
[ethernet]
27+
mac-address-blacklist=
28+
29+
[bond]
30+
miimon=100
31+
mode=active-backup
32+
33+
[ipv4]
34+
method=auto
35+
36+
[ipv6]
37+
method=auto
38+
39+
[proxy]
40+
----
41+
+
42+
. Create a connection profile for a secondary interface to add to the bond. For example, create the `bond0-proxy-em1.nmconnection` file in your local directory with the following content:
43+
+
44+
[source,ini]
45+
----
46+
[connection]
47+
id=em1
48+
type=ethernet
49+
interface-name=em1
50+
master=bond0
51+
multi-connect=1
52+
permissions=
53+
slave-type=bond
54+
55+
[ethernet]
56+
mac-address-blacklist=
57+
----
58+
+
59+
. Create a connection profile for a secondary interface to add to the bond. For example, create the `bond0-proxy-em2.nmconnection` file in your local directory with the following content:
60+
+
61+
[source,ini]
62+
----
63+
[connection]
64+
id=em2
65+
type=ethernet
66+
interface-name=em2
67+
master=bond0
68+
multi-connect=1
69+
permissions=
70+
slave-type=bond
71+
72+
[ethernet]
73+
mac-address-blacklist=
74+
----
75+
+
76+
. Retrieve the {op-system} ISO image from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and run the following command to customize the ISO image with your configured networking:
77+
+
78+
[source,terminal]
79+
----
80+
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
81+
--network-keyfile bond0.nmconnection \
82+
--network-keyfile bond0-proxy-em1.nmconnection \
83+
--network-keyfile bond0-proxy-em2.nmconnection
84+
----
85+
+
86+
Network settings are applied to the live system and are carried over to the destination system.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Module included in the following assemblies
2+
//
3+
// * installing/installing_bare_metal/installing-bare-metal.adoc
4+
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
5+
// * installing_bare_metal/installing-bare-metal-network-customizations.adoc
6+
7+
[id="installation-user-infra-machines-advanced-customizing-live-iso_{context}"]
8+
= Customizing a live {op-system} ISO image
9+
You can customize a live {op-system} ISO image directly with the `coreos-installer iso customize` subcommand. When you boot the ISO image, the customizations are applied automatically.
10+
11+
You can use this feature to configure the ISO image to automatically install {op-system}.
12+
13+
.Procedure
14+
15+
. Download the `coreos-installer` binary from the link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[`coreos-installer` image mirror] page.
16+
17+
. Retrieve the {op-system} ISO image from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and the Ignition config file, then run the following command to inject the Ignition config directly into the ISO image:
18+
+
19+
[source,terminal]
20+
----
21+
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
22+
--dest-ignition bootstrap.ign \ <1>
23+
--dest-device /dev/sda <2>
24+
----
25+
<1> The Ignition config file that is generated from `openshift-installer`.
26+
<2> When this option is specified, the ISO image automatically runs an install. Otherwise, the image remains configured for installing but will not do so automatically unless the `coreos.inst.install_dev` kernel argument is specified.
27+
+
28+
Your customizations are applied and affect every subsequent boot of the ISO image.
29+
30+
. To remove the ISO image customizations and return the image to its pristine state, run:
31+
+
32+
[source,terminal]
33+
----
34+
$ coreos-installer iso reset rhcos-<version>-live.x86_64.iso
35+
----
36+
+
37+
You can now re-customize the live ISO image or use it in its pristine state.

modules/installation-user-infra-machines-advanced.adoc

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ techniques that include:
1616

1717
* Passing kernel arguments to the live installer
1818
* Running `coreos-installer` manually from the live system
19-
* Embedding Ignition configs in an ISO
19+
* Customizing a live ISO or PXE boot image
2020
2121
The advanced configuration topics for manual {op-system-first}
2222
installations detailed in this section relate to disk partitioning, networking, and using Ignition configs in different ways.
@@ -272,77 +272,9 @@ command line with the `--ignition-url=` option. In both cases, only HTTP and HTT
272272
protocols are supported.
273273
+
274274

275-
* **Live install Ignition config**: This type must be created manually and should be avoided if possible, as it is not supported by Red Hat. With this method, the Ignition config passes to the live install medium, runs immediately upon booting, and performs setup tasks before and/or after the {op-system} system installs to disk. This method should only be used for performing tasks that must be done once and not applied again later, such as with advanced partitioning that cannot be done using a machine config.
275+
* **Live install Ignition config**: This type can be created by using the `coreos-installer` `customize` subcommand and its various options. With this method, the Ignition config passes to the live install medium, runs immediately upon booting, and performs setup tasks before or after the {op-system} system installs to disk. This method should only be used for performing tasks that must be done once and not applied again later, such as with advanced partitioning that cannot be done using a machine config.
276276
+
277277
For PXE or ISO boots, you can create the Ignition config
278278
and `APPEND` the `ignition.config.url=` option to identify the location of
279279
the Ignition config. You also need to append `ignition.firstboot ignition.platform.id=metal`
280280
or the `ignition.config.url` option will be ignored.
281-
282-
[id="installation-user-infra-machines-advanced_embed_ignition_{context}"]
283-
=== Embedding a live install Ignition config in the {op-system} ISO
284-
285-
You can embed a live install Ignition config directly in an {op-system} ISO image. When
286-
the ISO image is booted, the embedded config will be applied automatically.
287-
288-
[IMPORTANT]
289-
====
290-
This type of configuration must be created manually and should be avoided if possible, as it is not supported by Red Hat.
291-
====
292-
293-
.Procedure
294-
295-
. Download the `coreos-installer` binary from the following image mirror page: https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/.
296-
297-
. Retrieve the {op-system} ISO image and the Ignition config file, and copy them into an accessible directory, such as `/mnt`:
298-
+
299-
[source,terminal]
300-
----
301-
# cp rhcos-<version>-live.<architecture>.iso live.ign /mnt/
302-
# chmod 644 /mnt/rhcos-<version>-live.<architecture>.iso
303-
----
304-
305-
. Run the following command to embed the Ignition config into the ISO:
306-
+
307-
[source,terminal]
308-
----
309-
# ./coreos-installer iso ignition embed -i /mnt/live.ign \
310-
/mnt/rhcos-<version>-live.<architecture>.iso
311-
----
312-
+
313-
You can now use that ISO to install {op-system} using the specified live install
314-
Ignition config.
315-
+
316-
[IMPORTANT]
317-
====
318-
Using `coreos-installer iso ignition embed` to embed a file generated by `openshift-installer`, such as `bootstrap.ign`, `master.ign` and `worker.ign`, is unsupported and not recommended.
319-
====
320-
+
321-
. To show the contents of the embedded Ignition config and direct it into a file, run:
322-
+
323-
[source,terminal]
324-
----
325-
# ./coreos-installer iso ignition show /mnt/rhcos-<version>-live.<architecture>.iso > mylive.ign
326-
----
327-
+
328-
[source,terminal]
329-
----
330-
# diff -s live.ign mylive.ign
331-
----
332-
+
333-
.Example output
334-
[source,terminal]
335-
----
336-
Files live.ign and mylive.ign are identical
337-
----
338-
339-
. To remove the Ignition config and return the ISO to its pristine state so
340-
you can reuse it, run:
341-
+
342-
[source,terminal]
343-
----
344-
# ./coreos-installer iso ignition remove /mnt/rhcos-<version>-live.<architecture>.iso
345-
----
346-
+
347-
You can now embed another Ignition config into the ISO or use the ISO in its
348-
pristine state.

0 commit comments

Comments
 (0)