Menu Close
Settings Close

Language and Page Formatting Options

Red Hat Training

A Red Hat training course is available for Red Hat Container Development Kit

Chapter 5. Installing Red Hat Container Development Kit

Note

The installation process has been greatly simplified in Red Hat Container Development Kit 3.0, compared with earlier 2.x releases.

5.1. Installing on Microsoft Windows and macOS

Container Development Kit will be installed in the user’s personal directory. Virtualized boxes and configuration files will be stored under that directory.

Complete the following steps as a normal user (not root), to install Container Development Kit:

  1. Download the Red Hat Development Suite Installer from developers.redhat.com.
  2. Run the installation program for Red Hat Development Suite that you downloaded.
  3. Select Red Hat Container Development Kit components from the Red Hat Development Suite installer menu.

    This will automatically select hypervisor software for installation. The default hypervisor software for Microsoft Windows and macOS is VirtualBox, however you may also use Hyper-V on Microsoft Windows and xhyve on macOS.

5.2. Installing on Red Hat Enterprise Linux

Red Hat Container Development Kit installation on Red Hat Enterprise Linux uses the native RPM technology provided by Red Hat Enterprise Linux. Installing Container Development Kit requires several steps:

  1. As root, create the /etc/yum/repos.d/rh-devsuite.repo file and add the following content:

    [rh-devsuite]
    name=Red Hat Developemnt Suite RPMs
    baseurl=file://opt/rh-devsuite-repo/
    gpgkey=https://www.redhat.com/security/data/a5787476.txt
    enabled=1
    gpgcheck=1
  2. To install Red Hat Container Development Kit, run the following command:

    ~]$ sudo yum install cdk-minishift
  3. To setup Red Hat Container Development Kit, first create a symbolic link for minishift:

    ~]$ sudo ln -s /var/lib/cdk-minishift-3.0.0/minishift /usr/bin/minishift
  4. Install required CDK components, as a normal user:

    ~]$ minishift setup-cdk --force --default-vm-driver="kvm"

    Container Development Kit will install a KVM box in your home directory. You can find that installation under $HOME/.minishift as the user running Container Development Kit.

  5. Create a symbolic link to provide the oc utility:

    ~]$ sudo ln -s /home/$(whoami)/.minishift/cache/oc/v3.5.5.8/oc /usr/bin/oc
Note

oc must be in your PATH environment variable to execute Container Development Kit commands from the command line.

5.2.1. Configuring Container Development Kit on Red Hat Enterprise Linux

The minishift start command creates an OpenShift instance using the cluster up approach.

For this purpose it copies the oc binary onto your host. You will find it under ~/.minishift/cache/oc/3.5/oc, provided you use Minishift’s default version of OpenShift.

You can add this binary to your PATH using minishift oc-env which displays the command you need to type into your shell. The output of oc-env will differ depending on OS and shell type.

~]$ minishift oc-env
export PATH="/Users/john/.minishift/cache/oc/v1.5.0:$PATH"
# Run this command to configure your shell:
# eval $(minishift oc-env)
Note

Users who have already installed the executables minishift or oc need to ensure that the new executables that minishift provides do not conflict with those already installed. This is handled by default with oc-env, by putting the new Minishift executables in PATH first. To access the previous version, run which oc or which minishift and use the output to specify the absolute filename including directory.

As part of the minishift start command there is also a minishift oc context created. This context contains the configuration to communicate with your OpenShift cluster.

Minishift activates this context automatically, but if you need to switch back to it after for example, logging into another OpenShift instance, you can run:

~]$ oc config use-context minishift

For an introduction to oc usage, refer to the Get Started with the CLI topic in the OpenShift documentation.

5.3. Register the Red Hat Enterprise Linux Virtual Machine

Start Container Development Kit for the first time. You will need to set the environment variables MINISHIFT_USERNAME and MINISHIFT_PASSWORD to activate the Red Hat Enterprise Linux subscription used by your Minishift cluster. This will register the virtual machine that runs Red Hat Enterprise Linux, until it is released at shutdown. For further assistance in taking your first steps with Container Development Kit, see the Container Development Kit Getting Started Guide.

~]$ export MINISHIFT_USERNAME=<Red_Hat_username>
~]$ export MINISHIFT_PASSWORD=<Red_Hat_password>
~]$ minishift start

Instead of the environment variables MINISHIFT_USERNAME and MINISHIFT_PASSWORD, you may also specify the username and password on the command line:

~]$ minishift --username=<Red Hat username> --password=<Red Hat password> start

The start command should download any required OpenShift functionality, start OpenShift services, and print some helpful information about using the command line and web interfaces.

At this point, you should be able to use the tools minishift and oc to manage your Container Development Kit cluster.

5.4. Skip Registration

If you want to work with the virtual machine offline, you must register it to activate a Red Hat Enterprise Linux first. Container Development Kit also provides the ability for the VM to remain registered, so that you can skip that step. Skipping registration is convenient for working offline.

First, login with minishift while online:

~]$ minishift --username=<Red Hat username> --password=<Red Hat password> start

Next, stop minishift with a --skip-registration option. This shuts down the VM without releasing the Red Hat Enterprise Linux subscription.

~]$ minishift stop --skip-unregistration

Disconnect or log out as needed. While you are offline, use the --skip-registration option to skip the attempt to register the Red Hat Enterprise Linux VM at boot. The Red Hat Enterprise Linux subscription is still active on the virtual machine, so you do not need to specify your username and password.

~]$ minishift start --skip-registration