Skip to main content

Up and Running with Red Hat CodeReady Workspace IDE

Just another IDE? Yeah, you got it right, just another IDE. But this time, It's a special IDE designed for the Kubernetes developers. CodeReady Workspace IDE [1] includes tools and the dependencies that are needed to code, build, test, run, and debug the applications that run inside your Kubernetes clusters. It's hard to find the getting started guides in the Red Hat developer page so I tried and note it down here.

A. First, you need to have a running OpenShift Container Platform (OCP) instance

Right now CodeReady Workspace only works inside the OCP as far as I know [2] (there may be hackers out there know how to make it work in other platforms). The easiest way is to use the Red Hat Container Development Kit (CDK) [3] which helps you to have a smaller scale version of the OCP up and running, the minishift [4]. And, in order to install the CDK successfully, the recommended way is to install it inside a Red Hat Enterprise Linux (RHEL) server, register a Red Hat Developer account and you can download the ISO image for free here [5]. Below are the steps to install OCP inside an RHEL server (here I used RHEL7.6) that have 16GB of Memory and 8 cores CPU:

1. Install VirtualBox 5.2 [6]:  download the package for RHEL7 and install, right now, OCP installer does not work with VirtualBox 6x. Make sure you have updated your RHEL7 and install the gcc, make, and kernel-devel packages before running the installation.

2. Install and start the CDK:

  • Download the CDK from [3]
  • Rename the downloaded file to minishift and copy the binary file to /usr/local/bin or another directory that is accessible in your command-shell path.
  • Make sure the command is executable: chmod +x /usr/local/bin/minishift
  • Add these lines to $HOME/.bashrc:

export MINISHIFT_USERNAME=<Your Red Hat Developer account username>
export MINISHIFT_PASSWORD=<Your Red Hat Developer account password>

Save and exit.
  • Run the following commands:
# source $HOME/.bashrc
# minishift oc-env

Note the output to know the oc binary's path, for example, assuming you run the command as root: /root/.minishift/cache/oc/v3.11.43/linux
  • Add the oc binary's path to $HOME/.bash_profile:
PATH=$PATH:$HOME/bin:/usr/local/bin:/root/.minishift/cache/oc/v3.11.43/linux
export PATH

Save and exit.
  • Start the OpenShift cluster:
# source ~/.bash_profile
# minishift start

After that, an OpenShift cluster will be deployed in Virtualbox with the IP address 192.168.99.100.

B. Install the CodeReady Workspace IDE


1. Download the CodeReady Workspace IDE from [7] and extract it to a non-space path, for example, /home/cwo.

2. Login to your OCP cluster with an admin cluster account (not the system:admin) by the following command:

# oc login https://192.168.99.100:8443 -u developer -p developer

For some reason, I failed to deployed the CodeReady Workspace IDE using the admin user, only the developer user works.

3. Go to the extracted CodeReady Workspace directory, run the deployment script:

# cd /home/cwo
# ./deploy.sh --deploy

This will deploy the IDE with all the default configurations. If you want something else, have a look at the config.yaml file.

The deployment script will create a new project space name codeready and all the needed resources (deployments, pods, services, and routes).





After the deployment is finished, the IDE will be accessible from the RHEL7 server by this address: http://codeready-codeready.192.168.99.100.nip.io (this address is only accessible from the RHEL7 machine, for the outside world, you need to add some port forwarding in Virtualbox to expose your OpenShift instance).

So in the CodeReady Workspace dashboard, you first have to register an account.



Then, access the dashboard and enjoy the goodness!!!



And the selling point here is it doesn't take many resources from the host machine:



References:

[1] https://developers.redhat.com/products/codeready-workspaces/overview/
[2] https://developers.redhat.com/crw-hw/
[3] https://developers.redhat.com/products/cdk/download/
[4] https://www.okd.io/minishift/
[5] https://developers.redhat.com/products/rhel/download/
[6] https://www.virtualbox.org/wiki/Download_Old_Builds_5_2
[7] https://developers.redhat.com/products/codeready-workspaces/download/




Comments