Chapter 1. Using Kickstart files for installing MicroShift in RHEL


Use a Kickstart file that automates the installation of an RHEL image with MicroShift.

1.1. Kickstart files for embedding MicroShift with a RHEL installation

By using a Kickstart file, you automate a typical Red Hat Enterprise Linux (RHEL) installation by creating a single file containing all of the information required for success.

  • You can also automate your MicroShift installation by including MicroShift in the Kickstart file for the RHEL type that you choose.
  • You can use a Kickstart file to provision virtual machines (VMs) or to complete a regular RHEL installation for deployment on edge devices.

For MicroShift, your Kickstart file must include information to provision the RHEL system to meet the following requirements:

  • A RHEL system you provision must meet the requirements for installing MicroShift.
  • The RHEL file system must have a logical volume manager (LVM) volume group (VG) with sufficient capacity for the persistent volumes (PVs) of your workload.
  • A pull secret from the Red Hat Hybrid Cloud Console must be present as /etc/crio/openshift-pull-secret and have root user-only read/write permissions.

1.1.1. Setting up the MicroShift Kickstart file

You can use the Kickstart file provided with MicroShift to provision a host by following the instructions for your install type. The ISO you created in the previous steps then runs on the host that you provision with your Kickstart file. To get started with the MicroShift Kickstart file, begin with the following procedure.

Prerequisites

  • The host you are provisioning must meet the system requirements for installing MicroShift.
  • A pull secret from ~/.pull-secret.json must be present and have read permissions for the current user.

Procedure

  1. Install the microshift-release-info RPM package containing the sample Kickstart files that are in the /usr/share/microshift/kickstart directory by running the following command:

    $ sudo dnf install -y microshift-release-info
  2. Install the utilities used during the Kickstart file creation by running the following command:

    $ sudo dnf install -y openssl gettext
  3. Set the variables pointing to secrets included in kickstart.ks.

    • The PULL_SECRET file contents are copied to the /etc/crio/openshift-pull-secret directory at the post-installation stage to authenticate OpenShift Container Platform container registry access.

      Example command setting the PULL_SECRET variable:

      $ export PULL_SECRET="$(cat ~/.pull-secret.json)"

    • Set a password in the PASSWD_TEXT variable to use in the`USER_PASSWD` setting by running the following command:

      Example command setting the PASSWD_TEXT variable.

      $ PASSWD_TEXT=<my_redhat_user_plain_text_password> 1

      1
      Replace <my_redhat_user_plain_text_password> with the password you want to use.
    • The USER_PASSWD setting is used as an encrypted password for the redhat user for logging into the host. Encrypt your password string using the SHA-512 encryption standard.

      Example command setting the USER_PASSWD variable.

      $ export USER_PASSWD="$(openssl passwd -6 "${PASSWD_TEXT}")"  1

      1
      Only the encrypted password is included in the Kickstart file. The plain text password is not.

Next steps

  1. Follow the instructions for your installation type to create a working Kickstart file from the provided template. Instructions for RPM-based, RHEL for Edge, and image mode for RHEL installations follow this procedure.
  2. Optional. Create a virtual machine (VM) using the Kickstart file. Creating a VM allows you to test and validate the values in your Kickstart file.

1.1.2. Creating a Kickstart file for a MicroShift RPM installation

Use the Kickstart file provided with MicroShift to provision an RPM-based virtual machine.

Prerequisites

Important

The subscription must include access to the rhocp-4.x-for-rhel-9-$(uname -m)-rpms and fast-datapath-for-rhel-9-$(uname -m)-rpms RPM repositories.

Procedure

  1. Add the following variables to create an RPM Kickstart file:

    Example commands setting the Kickstart file variables.

    • The RHSM_ORG variable contains a Red Hat Subscription Manager organization ID for the subscription registration command in the Kickstart file.

      $ export RHSM_ORG="$(cat ~/.rhsm-activation-org)"
    • The RHSM_KEY variable contains a Red Hat Subscription Manager activation key for the subscription registration command in the Kickstart file.

      $ export RHSM_KEY="$(cat ~/.rhsm-activation-key)"
    • The MICROSHIFT_VER variable references the MicroShift version to install using the 4.y format. The latest available .z version of the 4.y version set in this variable is automatically installed.

      $ export MICROSHIFT_VER=4.17 1
      1
      For the minor version you set, the latest z-stream of that version is installed.
  2. Run the following command to create the kickstart.ks file to be used during the virtual machine installation:

    envsubst < \
        /usr/share/microshift/kickstart/kickstart-rpm.ks.template > \
        "${HOME}/kickstart.ks"

1.1.3. Creating a Kickstart file for a MicroShift RHEL for Edge installation

Use the Kickstart file provided with MicroShift to provision a RHEL for Edge-based virtual machine.

Prerequisites

  • You set up the MicroShift Kickstart file.
  • You have the information needed to set required and optional variables.

Procedure

  1. Add the following required variables to create an RHEL for Edge Kickstart file:

    Example commands setting required variables.

    • The OSTREE_SERVER_URL variable contains an rpm-ostree server URL that is passed to the ostreesetup Kickstart command.

      $ export OSTREE_SERVER_URL="<http://my_ostree_server_url>" 1
      1
      Replace http://my_ostree_server_url with your server URL.
    • The OSTREE_COMMIT_REF variable contains an rpm-ostree commit reference that is installed from the server.

      $ export OSTREE_COMMIT_REF="<myostree_commit_reference>" 1
      1
      Replace <myostree_commit_reference> with the rpm-ostree commit reference.
  2. Optional. Add the following variable for server authentication:

    • The AUTH_CONFIG contents are copied to /etc/ostree/auth.json at the pre-install stage to authenticate access to the OSTREE_SERVER_URL server. If no server authentication is required, skip this setting.

      $ export AUTH_CONFIG="$(cat ~/.ostree-auth.json)"
  3. Run the following command to create the kickstart.ks file to be used during the installation:

    envsubst < \
        /usr/share/microshift/kickstart/kickstart-ostree.ks.template > \
        "${HOME}/kickstart.ks"
Note

The MicroShift version specified in the rpm-ostree commit is installed. To change the version of MicroShift, you must create a new commit.

1.1.4. Creating a Kickstart file for installing MicroShift on image mode for RHEL

You can use the Kickstart file provided with MicroShift for an image mode for RHEL installation.

Prerequisites

  • You set up the MicroShift Kickstart file.
  • You have the information needed to set required and optional variables.

Procedure

  1. Set the required BOOTC_IMAGE_URL variable value to point to an image used in the RHEL Kickstart file installation process by running the following command:

    $ export BOOTC_IMAGE_URL=<myregistry>/<myorg>/<mypath>/microshift-image:tag 1
    1
    Replace <myregistry>,<myorg>, and <mypath> with your information.
    • The BOOTC_IMAGE_URL variable contains a reference to the image that is installed with the ostreecontainer command. You can specify a z-stream release other than the latest by using the tag if required.
  2. Optional. Add variables and values for registry authentication and configuration by using the following commands:

    Example commands setting optional variables

    • Set the AUTH_CONFIG variable to authenticate access to the BOOTC_IMAGE_URL image by running the following command:

      $ export AUTH_CONFIG="$(cat ~/.quay-auth.json)" 1
      1
      See the containers-auth.json(5) manual page for more information about this file format.
    • Set the REGISTRY_CONFIG variable to configure access to the registry containing the BOOTC_IMAGE_URL image by running the following command:

      $ export REGISTRY_CONFIG="$(cat ~/.quay-config.conf)" 1
      1
      See the containers-registries.conf(5) manual page for more information about this file format.
  3. Create the kickstart.ks file to be used during the installation by running the following command:

    envsubst < \
        /usr/share/microshift/kickstart/kickstart-bootc.ks.template > \
        "${HOME}/kickstart.ks"
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.