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>'
end

Mac OS X Prereqs

RedHat Container Developer Kit Setup

  • Download Red Hat Container Developer Kit cdk-2.0.0.zip 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*.x86_64.vagrant-virtualbox.box
    
    • Remove ~/Downloads/rhel-cdk-kubernetes-7.2*.x86_64.vagrant-virtualbox.box

Getting Started

  • Start CDK and print helpful environment info
cd ~/cdk/components/rhel/rhel-ose/
vagrant up
vagrant provision
  • Access the console at https://10.1.2.2:8443/console 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
curl http://helloflask-sample-project.rhel-cdk.10.1.2.2.xip.io/api

How the heck did that work?! Checkout xip.io.

  • SSH to your openshift VM and list the openshift images
cd ~/cdk/components/rhel/rhel-ose/
vagrant ssh
[vagrant@rhel-cdk ~]$ docker search registry.access.redhat.com/openshift3
INDEX        NAME                                                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
redhat.com   registry.access.redhat.com/openshift3/image-inspector             Image Inspector can extract the RPM compos...   0
redhat.com   registry.access.redhat.com/openshift3/jenkins-1-rhel7             Jenkins image which can be used to set up ...   0
redhat.com   registry.access.redhat.com/openshift3/logging-auth-proxy          Container used to enable authorization and...   0
...
  • Try each of these
$ docker search registry.access.redhat.com/rhscl
$ docker search registry.access.redhat.com/openshift3
$ docker search registry.access.redhat.com/rhel
$ docker search registry.access.redhat.com/jboss

Neat hu?

Updating CDK

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

  • Download Red Hat Container Developer Kit cdk-2.1.0.zip 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*.x86_64.vagrant-virtualbox.box

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