Developer tools Setup
To prepare to use the CNCF DevOps tools you need to prepare a development client. This can be either your desktop, the IBM Cloud Shell or when using OpenShift you can use Cloud Ready Workspaces.
- If you are going to use your desktop/laptop follow the instructions in Desktop/Laptop tab. You will require a modern MacOS or Windows 10 operating systems for he Desktop/Laptop option
- If you cannot install tools on your desktop/laptop, follow the Cloud Shell instructions
- If you want to try the full web IDE experience, then follow the Code Ready Workspaces setup instructions
Once you have completed these setup requirements you will be ready to deploy you first application with a CI/CD pipeline that supports Code scanning.
IBM Cloud Shell is instantly accessible from your IBM Cloud account — no other installation is needed.
IBM Cloud Shell is a free service from IBM which gives you complete control of your cloud resources, applications and infrastructure, from any web browser.
Features of IBM Cloud Shell include:
Preconfigured environment IBM Cloud Shell provides a curated, cloud-based workspace with dozens of preinstalled tools and programming languages. It automatically authenticates to your IBM Cloud account so you can get right to work.
File upload/download Utilize file upload/download functionality to import files to IBM Cloud Shell, or pull down data to your local machine.
Multiple sessions Use up to five shell sessions at a time to maximize your productivity. Mirror workflows on your local machine, or view logs on one session while editing a file in another
Login to IBM Cloud console (cloud.ibm.com), if not already done
Invoke Cloud shell by clicking on the button at the top right hand corner of the browser window
Install IBM Garage Cloud Toolkit CLI by running the following commands on the just newly opened terminal:git clone https://github.com/ibm-garage-cloud/cloud-shell-commands.gitexport PATH=~/cloud-shell-commands:$PATHsource ./cloud-shell-commands/install-igc
This CLI adds a number of alias commands to
Successful execution will look like this.$ git clone https://github.com/ibm-garage-cloud/cloud-shell-commands.gitCloning into 'cloud-shell-commands'...remote: Enumerating objects: 50, done.remote: Counting objects: 100% (50/50), done.remote: Compressing objects: 100% (44/44), done.remote: Total 50 (delta 23), reused 14 (delta 4), pack-reused 0Unpacking objects: 100% (50/50), done.Checking connectivity... done.$ export PATH=~/cloud-shell-commands:$PATH
Check the version of the CLI commands$ kubectl sync --version0.5.3
The following is a list of desktop tools required to help with installation and development.
Git Client: Needs to be installed in your development operating system, it comes as standard for Mac OS
IBM Cloud CLI: Required for management of IBM Cloud Account and management of your managed IBM Kubernetes and Red Hat OpenShift clusters
- Don’t install just the IBM Cloud CLI, install the IBM Cloud CLI and Developer Toolscurl -sL https://ibm.biz/idt-installer | bash
- Note: If you log in to the web UI using SSO, you’ll need to create an API key for logging into the CLI. (You can also use this API key for installing the Developer Tools environment.)
- Don’t install just the IBM Cloud CLI, install the IBM Cloud CLI and Developer Tools
OpenShift OC CLI: Required for Red Hat OpenShift management and development
kubectlin your Terminal
Once downloaded navigate to Download foldercd ~/Downloads/openshift-origin-client-tools-v3/
kubectlto the system-wide available scripts folder (which is already in your PATH)cp kubectl /usr/local/bin/kubectlcp oc /usr/local/bin/oc
- Installed and running on your local machine
- Installed on your local machine
IBM Garage for Cloud CLI: Used to help make working with the development tools as easy as possiblenpm i -g @ibmgaragecloud/cloud-native-toolkit-cli
- This will install a number of alias functions into
ocCLI tools including
- This will install a number of alias functions into
Tekton CLI: Used to help control Tekton pipelines from the command line.brew tap tektoncd/toolsbrew install tektoncd/tools/tektoncd-cli
Visual Studio Code: A popular code editor
- You will be required to edit some files, having a good quality editor is always best practice
- Enabling launching VSCode from a terminal
JDK 11: Optional installed on your local machine
- Used for SpringBoot content
CodeReady Workspaces is a developer workspace server and cloud IDE. Workspaces are defined as project code files and all of their dependencies necessary to edit, build, run, and debug them. Each workspace has its own private IDE hosted within it. The IDE is accessible through a browser. The browser downloads the IDE as a single-page web application. CodeReady Workspaces will enable a 100% developer experience to be delivered from a users browser.
Red Hat CodeReady Workspaces provides:
- Workspaces that include runtimes and IDEs
- RESTful workspace server
- A browser-based IDE
- Plugins for languages, framework, and tools
- An SDK for creating plugins and assemblies
CodeReady Workspaces includes a powerful in-browser IDE with support for Microsoft Visual Studio Code extensions. As part of the workshop, we need only a machine capable of running a web browser through which CRW will provide an integrated environment to access the code repo, and the build environment to develop the code and then test, and deploy on an OpenShift environment
Login to the Openshift Cluster through the Web console, where the Code ready workspace is setup.
Access the Code Ready Workspace through the appropriate Code ready workspace URL that would have been shared. Note:If the code ready workspace is configured through openshiftoAuth, You can access the above URL, once you have logged into the Openshift Cluster
If you are accessing it for the first time you need register as the registration page will be shown. User name can contain only these characters (0-9, a-z and hypen in between). Ensure you provide details regarding username, Email, First name and Last name (If SSO is not configured, you need to provide the password as well.
Navigate to the default Code Ready Workspace link on your browser as shown in below picture.
You can create the workspace by selecting one of the template stacks as shown in Step 4. Alternatively, navigate to the Workspace and click on the “Add Workspace” button.
Provide the workspace as part of the Name field. Click on “Remove” button in the Projects section to remove the project template. Basically, we are going to create an empty project.
Click on “Create and Open” button to create and load the workspace. Workspace will start loading. This may take a few minutes as the Container and plug-ins related to the stack has to be created and deployed.
Once the workspace is created and loaded, you can see a vscode editor.
Go to “Terminal” menu and select “Open Terminal in specific container”.
Select the “Developer Container”.
Install igc by running the following commands on the just newly opened terminal:git clone https://github.com/ibm-garage-cloud/cloud-shell-commands.gitexport PATH=~/cloud-shell-commands:$PATHsource ./cloud-shell-commands/install-igc
Successful installation will look something like this.
ibmcloudCLI command line to log into the cloud account. Replace the user_id, password and team name in the sandbox nameibmcloud login -u <user_id> -p <password> -g <resource group>.. -r <region>
The fastest way to login the IBM Cloud is to select the Log in to CLI and API menu
Use the command for IBM Cloud
The follow steps enable you to operate the IBM managed cluster using IBM Cloud Shell
Log into the Kubernetes cluster from the cloud console
Access the Kubernetes dashboard by clicking on the button
Follow the steps to log in Kubernetes cluster
Log into the openshift cluster from the cloud console
Access the openshift console by clicking on the button
Get the login command with token to login to the openshift from command line
Execute the login command copied in the last step in the terminal$ oc login --token=qvARHflZDlOYfjJZRJUEs53Yfy4F8aa6_L3ezoagQFM --server=https://c103-e.us-south.containers.cloud.ibm.com:30979Logged into "https://c103-e.us-south.containers.cloud.ibm.com:30979" as "IAM#email@company" using the token provided.You have access to 71 projects, the list has been suppressed. You can list all projects with 'oc projects'Using project "dev-ab".$
You need to configure your get identity so you are able to clone code into your cloud shell.
Execute the following commandsgit config --global user.email "<email>"git config --global user.name "<short_name>"