mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
95 lines
3.9 KiB
Plaintext
95 lines
3.9 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// microshift_install_rpm_ostree/microshift-embed-in-rpm-ostree.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="microshift-embed-kickstart-iso_{context}"]
|
|
= Embedding a Kickstart file in an ISO
|
|
|
|
[role="_abstract"]
|
|
You can use the Kickstart file provided with {microshift-short}, or you can update an existing {op-system-ostree} Installer (ISO) Kickstart file.
|
|
|
|
When ready, embed the Kickstart file into the ISO. Your Kickstart file must include detailed instructions about how to create a user and how to fetch and deploy the {op-system-ostree} image.
|
|
|
|
For information about Kickstarts, see the following links:
|
|
|
|
* link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/automatically_installing_rhel/creating-kickstart-files_rhel-installer[Creating Kickstart files]
|
|
* link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/automatically_installing_rhel/kickstart-script-file-format-reference_rhel-installer#kickstart-file-format_kickstart-script-file-format-reference[A.1. Kickstart file format]
|
|
* link:https://access.redhat.com/solutions/60959[How to embed a Kickstart file into an ISO image]
|
|
|
|
.Prerequisites
|
|
|
|
* You created a {op-system-ostree} Installer (ISO) image containing your {op-system-ostree} commit with {microshift-short}.
|
|
|
|
* You have an existing Kickstart file ready for updating. You can use the `microshift-starter.ks` Kickstart file provided with the {microshift-short} RPMs.
|
|
|
|
.Procedure
|
|
|
|
. In the main section of the Kickstart file, update the setup of the filesystem such that it contains an LVM volume group called `rhel` with at least 10GB system root. Leave free space for the LVMS CSI driver to use for storing the data for your workloads.
|
|
+
|
|
.Example Kickstart file snippet for configuring the filesystem
|
|
[source,text]
|
|
----
|
|
# Partition disk such that it contains an LVM volume group called `rhel` with a
|
|
# 10GB+ system root but leaving free space for the LVMS CSI driver for storing data.
|
|
#
|
|
# For example, a 20GB disk would be partitioned in the following way:
|
|
#
|
|
# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
|
|
# sda 8:0 0 20G 0 disk
|
|
# ├─sda1 8:1 0 200M 0 part /boot/efi
|
|
# ├─sda1 8:1 0 800M 0 part /boot
|
|
# └─sda2 8:2 0 19G 0 part
|
|
# └─rhel-root 253:0 0 10G 0 lvm /sysroot
|
|
#
|
|
ostreesetup --nogpg --osname=rhel --remote=edge \
|
|
--url=file:///run/install/repo/ostree/repo --ref=rhel/<RHEL VERSION NUMBER>/x86_64/edge
|
|
zerombr
|
|
clearpart --all --initlabel
|
|
part /boot/efi --fstype=efi --size=200
|
|
part /boot --fstype=xfs --asprimary --size=800
|
|
# Uncomment this line to add a SWAP partition of the recommended size
|
|
#part swap --fstype=swap --recommended
|
|
part pv.01 --grow
|
|
volgroup rhel pv.01
|
|
logvol / --vgname=rhel --fstype=xfs --size=10000 --name=root
|
|
# To add users, use a line such as the following
|
|
user --name=<YOUR_USER_NAME> \
|
|
--password=<YOUR_HASHED_PASSWORD> \
|
|
--iscrypted --groups=<YOUR_USER_GROUPS>
|
|
----
|
|
|
|
. In the `%post` section of the Kickstart file, add your pull secret and the mandatory firewall rules.
|
|
+
|
|
.Example Kickstart file snippet for adding the pull secret and firewall rules
|
|
[source,terminal]
|
|
----
|
|
%post --log=/var/log/anaconda/post-install.log --erroronfail
|
|
|
|
# Add the pull secret to CRI-O and set root user-only read/write permissions
|
|
cat > /etc/crio/openshift-pull-secret << EOF
|
|
YOUR_OPENSHIFT_PULL_SECRET_HERE
|
|
EOF
|
|
chmod 600 /etc/crio/openshift-pull-secret
|
|
|
|
# Configure the firewall with the mandatory rules for MicroShift
|
|
firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16
|
|
firewall-offline-cmd --zone=trusted --add-source=169.254.169.1
|
|
|
|
%end
|
|
----
|
|
|
|
. Install the `mkksiso` tool by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo yum install -y lorax
|
|
----
|
|
|
|
. Update the ISO with your new Kickstart file by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo mkksiso <your_kickstart>.ks <your_installer>.iso <updated_installer>.iso
|
|
----
|