Install into Red Hat CodeReady Containers
Prepare to install developer tools into Red Hat CodeReady Containers on your laptop
The IBM Garage for Cloud Developer Tools facilitate development and deployment of cloud-native applications. They can be hosted in any Kubernetes or OpenShift cluster, including the Red Hat CodeReady Containers local OpenShift environment.
These instructions help you install Red Hat CodeReady Containers and explain how to configure and run the Terraform infrastructure-as-code (IasC) scripts to install the Developer Tools into that CodeReady Containers install.
The following prerequisites are required to support installing CodeReady Containers:
The following prerequisites are required before following the setup instructions:
- Install the Prerequisites listed before continuing
Download CodeReady Containers (CRC) and install it
Install and configure CRC as described in Install on Laptop
Remember to take a copy of Pull Secret
CRC executable: Copy the crc binary to your $PATH:
From the directory where you unzipped the download:cp crc /usr/local/bin
Follow these steps to complete the installation:
Setup: Run the following command from a terminal session:crc setup
Add memory: By default, the CRC VM is set to only use 8 GB of RAM. The more RAM you can give it, the better.
To set the CRC VM to 10 GB of RAM, do this:crc config set memory 10240
Start the local CRC Cluster
Run the crc start command in a terminal window:crc start
During the start process, you will be prompted for your pull secret. Copy and paste it into the terminal window.
Wait about 5 minutes for the VM initialization to complete. When complete, the kubeadmin password will be displayed. Make note of this password because you will need it to log into the console.
Open the Cluster Admin Consolecrc console
Open a web browser and go to the OpenShift console
Login with user id kubeadmin and the password that was displayed after the
crc starthad completed.
Other useful links:
Obtain the Terraform infrastructure-as-code (IasC) scripts that will install the tools into CodeReady Containers
Clone the ibm-garage-iteration-zero Git repository to your local filesystemgit clone email@example.com:ibm-garage-cloud/ibm-garage-iteration-zero.git
Switch to the cloned directorycd ibm-garage-iteration-zero
Configure the keys the CLI uses to authenticate
API keys are not needed to connect to CRC, but the file must still exist.
credentials.templateto a file named
credentials.properties.cd iteration-zero-ibmcloudcp credentials.template credentials.properties
credentials.propertiesfile and set the
ibmcloud.api.keyproperty to the admin password displayed in the terminal when CRC was started.
Configure the properties describing the environment
The settings for installing the Developer Tools go in a single property file
environment.tfvars— Properties for installing the Developer Tools
environment.tfvars properties to configure the installation for the Development Tools.
Set the following properties so they match below, all the other properties will be ignored:# The type of cluster that will be created/used (kubernetes, openshift, or crc)cluster_type="crc"# Flag indicating if we are using an existing cluster or creating a new onecluster_exists="true"# Enter any value for the resource group nameresource_group_name="crc-resource-group"# Flag indicating if we are using an existing postgres server or creating a new onepostgres_server_exists="false"
Run Terraform to install the tools into the CRC environment
Having configured the
environment.tfvars properties files,
we are now ready to kick off the installation.
Launch a Developer Tools Docker container.
Run the following command to run the Docker container:./launch.sh
For more information on the Developer Tools Image see the following guide:
This will install the Cloud Garage Tools Docker image and exec shell into the running container. The container will mount the filesystem’s
/home/devops/src/. Once the Docker container has started and the script has exec shelled into it, you will see an IBM Garage banner. This will help you identify you are running inside the Docker image that has just mounted your file system.
The supplied Terraform scripts are ready to run using the settings in the properties files. You optionally can extend or modify the scripts and tailor them for your project’s specific needs.
From inside the terminal/container run this script:./runTerraform.sh
This script will setup the Developer Tools in the CRC environment.
The script will verify some basic settings and prompt if you want to proceed. After you select Y (for yes), the Terraform Apply process will begin to create the infrastructure and services for your environment.
The existing cluster’s contents will be cleaned up to prepare for the terraform process. Any resources in the
stagingnamespaces/projects will be deleted.
Installing the tools into an existing cluster takes about 20 minutes.
Once the Terraform scripts have finished, you can see the resources that the scripts created.
To see this:
- Open the OpenShift web console. You should see:
- Deployments in the
To get started with code using the following guides:
If you find that that the Terraform provisioning has failed, try re-running the
runTerraform.sh script again.
The state will be saved and Terraform will try and apply the configuration to match the desired end state.