Getting Started With RedHat Container Development Kit

June 16, 2016

The RedHat Container Developer Kit allows you to deploy OpenShift on your laptop for easier testing and development. Here is how to deploy it.

OpenShift CDK

Register as a RedHat Developer

  • Obtain a RH login

  • Place credentials in ~/.vagrant.d/Vagrantfile to enable updates for VMs by automatically registering with RedHat Subscription Manager

Vagrant.configure('2') do |config|
 config.registration.username = '<your Red Hat username>'
 config.registration.password = '<your Red Hat password>'

Mac OS X Prereqs

RedHat Container Developer Kit Setup

  • Download Red Hat Container Developer Kit from here and unzip to ~/cdk.

  • Follow the Install Docs to:

    • Install vagrant plugins
    cd ~/cdk/plugins
    vagrant plugin install *.gem
    • Import the vagrant box to ~/.vagrant.d/boxes/
    vagrant box add --name cdkv2 ~/Downloads/rhel-cdk-kubernetes-7.2*
    • Remove ~/Downloads/rhel-cdk-kubernetes-7.2*

Getting Started

  • Start CDK and print helpful environment info
cd ~/cdk/components/rhel/rhel-ose/
vagrant up
vagrant provision
  • Access the console at using a credential below:

    • User: openshift-dev Pass: devel
    • User: admin Pass: admin
  • If you forget where to find the console vagrant can remind you

cd ~/cdk/components/rhel/rhel-ose/
vagrant service-manager env openshift
  • Curl the sample app that ships in the CDK

How the heck did that work?! Checkout

  • SSH to your openshift VM and list the openshift images
cd ~/cdk/components/rhel/rhel-ose/
vagrant ssh
[vagrant@rhel-cdk ~]$ docker search
INDEX        NAME                                                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED             Image Inspector can extract the RPM compos...   0             Jenkins image which can be used to set up ...   0          Container used to enable authorization and...   0
  • Try each of these
$ docker search
$ docker search
$ docker search
$ docker search

Neat hu?

Updating CDK

CDK 2.1 is out now with OpenShift Enterprise 3.2. Let’s update!

  • Download Red Hat Container Developer Kit from here and unzip to ~/cdk-2.1.
mv ~/cdk ~/cdk-2.0
ln -s ~/cdk-2.1 ~/cdk
  • Update Vagrant Plugins
$ cd ~/cdk/plugins

$ vagrant plugin list
landrush (0.15.3)
vagrant-dnsmasq (0.1.1)
vagrant-hostmanager (1.6.0)
vagrant-registration (1.2.1)
  - Version Constraint: 1.2.1
vagrant-service-manager (1.0.1)
  - Version Constraint: 1.0.1
vagrant-share (1.1.4, system)
vagrant-sshfs (1.1.0)
  - Version Constraint: 1.1.0

$ ls *gem
vagrant-registration-1.2.2.gem          vagrant-service-manager-1.1.0.gem       vagrant-sshfs-1.1.0.gem

$ vagrant plugin install vagrant-registration-1.2.2.gem
Installing the 'vagrant-registration-1.2.2.gem' plugin. This can take a few minutes...
Installed the plugin 'vagrant-registration (1.2.2)'!
$ vagrant box add --force --name cdkv2 rhel-cdk-kubernetes-7.2*

Now go back to Getting Started and fire up your new CDK 2.1 VM.

More Info

Check out my post on deploying metrics to CDK.

comments powered by Disqus