Chapter 2. Startup
Red Hat Container Development Kit for Red Hat Enterprise Linux includes a KVM virtual machine image running Red Hat Enterprise Linux, that is running an OpenShift cluster for local use. Container Development Kit primarily uses minishift
and oc
commands to manage the OpenShift cluster. Users can deploy applications to the local OpenShift cluster, like they would for any other OpenShift cluster. This simplifies application development on the desktop and deployment to production systems.
Before we can do anything else with the OpenShift cluster, we need to start it. Then we can work with Container Development Kit and the other examples.
Container Development Kit has several prequisites, that must be met at startup:
- A computer system with virtualization turned on in the hardware.
- A Red Hat Enterprise Linux, Microsoft Windows, or macOS desktop system installed on that hardware. The command line examples are all taken from a Red Hat Enterprise Linux desktop.
- A Red Hat Enterprise Linux license for the virtual machine running Red Hat Enterprise Linux. This is in addition to the Red Hat Enterprise Linux license for your desktop.
-
Container Development Kit installed on the desktop, with
minishift
andoc
commands available.
Container Development Kit registers a Red Hat Enterprise Linux virtual machine by default during startup, on all operating systems.
2.1. Register the Container Development Kit Red Hat Enterprise Linux Virtual Machine
Starting Container Development Kit requires a valid Red Hat Enterprise Linux license, because Container Development Kit includes an KVM virtual machine image with Red Hat Enterprise Linux installed.
At startup, minishift
registers the Red Hat Enterprise Linux license, and holds it until it is released at shutdown. The login information for that Red Hat Enterprise Linux license can be provided either on the command line or as environment variables.
To start Container Development Kit using environment variables, first set MINISHIFT_USERNAME
and MINISHIFT_PASSWORD
:
~]$ export MINISHIFT_USERNAME=<Red_Hat_username> ~]$ export MINISHIFT_PASSWORD=<Red_Hat_password>
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>
2.2. Starting Container Development Kit
The minishift start
command downloads any required OpenShift functionality, starts OpenShift services, and prints some helpful information about 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. Start by running the minishift start
command.
~]$ minishift start
Starting local OpenShift cluster using 'kvm' hypervisor...
...
OpenShift server started.
The server is accessible via web console at:
https://192.168.99.128:8443
You are logged in as:
User: developer
Password: developer
To login as administrator:
oc login -u system:admin
-
The IP is dynamically generated for each OpenShift cluster. To check the IP, run the
minishift ip
command. -
By default, Minishift uses the driver most relevant to the host OS. To use a different driver, set the
--vm-driver
flag inminishift start
. For example, to use VirtualBox instead of KVM on GNU/Linux operating systems, runminishift start --vm-driver=virtualbox
.
Use minishift oc-env
to display the command you need to type into your shell in order to add the oc
binary to your PATH
. The output of oc-env
may differ, depending on OS and shell type.
~]$ minishift oc-env export PATH="/home/<username>/.minishift/cache/oc/v1.5.0:$PATH" # Run this command to configure your shell: # eval $(minishift oc-env)
For more information about interacting with OpenShift with the command-line interface and the web console, see the Chapter 7, Interacting with OpenShift section.