Running CDK 3.0 on Fedora 25

-1+1 (No Ratings Yet)

Red Hat Container Development Kit (CDK) provides a Container Development Environment (CDE) that allows users to build a virtualized environment for OpenShift. This environment is similar to the user’s production environment and does not need other hardware or a physical cluster. CDK is designed to work on a single user’s desktop computer.

The following instructions are to install and use CDK with Fedora 25, but can also be used for earlier versions of Fedora.

A significant difference between CDK version 2.x and 3.x is that 3.x uses Minishift as the front-end for virtualized environments while CDK 2.x used Vagrant for this purpose. As a result, the CDK 3.0 installation process is significantly simpler.

To install CDK 3.0 on Fedora:

1. Set up your Virtualization Environment

2. Install and Configure the CDK Software Components

3. Start CDK

Setup your virtualization environment
You need to first install the virtualization software, KVM/libvirt in this case, and then install additional Docker plugins to communicate with the virtualization software.

Install the software that supports virtualization on Fedora as follows:

1. Install KVM and libvirt:

~]$ sudo dnf group install with-optional virtualization

2. Download the driver plugin required for kvm support:

~]$ sudo curl -L -o /usr/local/bin/docker-machine-driver-kvm
~]$ sudo chmod +x /usr/local/bin/docker-machine-driver-kvm

3. Launch the libvirt daemon and configure it to start at boot:

~]$ sudo systemctl start libvirtd
~]$ sudo systemctl enable libvirtd

4. Enable permissions required to use libvirt. Create a new group and activate it like this (logging out and back in should also have the same effect, for our purposes):

~]$ sudo gpasswd -a ${USER} libvirt
~]$ newgrp libvirt

5. Restart the libvirt and PolicyKit services for the changes to take effect:

~]$ sudo systemctl restart libvirtd
~]$ sudo systemctl restart polkit

Note: If you get an error “PolicyKit daemon disconnected from the bus”, the workstation is no longer a registered authentication agent. Run the `systemctl status polkit` command to troubleshoot this problem. If the status is active (running), you can continue the installation.

Install and configure CDK software components
Download Red Hat CDK from the Red Hat Developers website, and prepare it for installation:

1. Download the CDK software.

The following steps assume that you have downloaded CDK in the ~/Downloads directory. The filename should be ~/Downloads/cdk-3.0-minishift-linux-amd64.

2. Create a directory to store the download permanently, and copy it there:

~]$ mkdir -p ~/bin
~]$ cp ~/Downloads/cdk-3.0-minishift-linux-amd64 ~/bin/minishift
~]$ chmod +x ~/bin/minishift
~]$ export PATH=$PATH:$HOME/bin
~]$ echo ‘export PATH=$PATH:$HOME/bin’ >> ~/.bashrc

Note: `minishift` needs to be in your $PATH. If that’s not easily possible, you can run it as `./minishift` from the installation directory containing minishift.

3. Configure minishift. This will create the directory “$HOME/.minishift”, which includes the virtual machine image and configuration files

~]$ minishift setup-cdk

Starting CDK

You must start the box using minishift. CDK includes a virtualized Red Hat Enterprise Linux environment running in a kvm / qemu virtual machine. This Red Hat Enterprise Linux environment provides you with a single-user version of OpenShift and Kubernetes.

1. Add the following lines to ~/.bashrc to register the virtual machine running Red Hat Enterprise Linux. Replace and with the credentials for that you also use to install other Red Hat Enterprise Linux systems:

~]$ echo “export MINISHIFT_USERNAME=\”$MINISHIFT_USERNAME\”” >> ~/.bashrc
~]$ echo “export MINISHIFT_PASSWORD=\”$MINISHIFT_PASSWORD\”” >> ~/.bashrc

2. Start CDK with OpenShift Container Platform setup as follows:

~]$ minishift start

Note: This returns a detailed message with tips to access the OpenShift console and CLI.

3. Verify that your kvm VM is running, to ensure you are ready to use CDK, as follows:

~]$ minishift status

Congratulations, CDK is now running on your Fedora 25 desktop!

Whether you are new to Containers or have experience, downloading this cheat sheet can assist you when encountering tasks you haven’t done lately.

What did you think of this article?
-1+1 (No Ratings Yet)