Getting started with solution tutorials
Solution tutorials provide step-by-step instructions on how to use IBM Cloud to implement common patterns based on best practices and proven technologies.
Before going through the tutorials collection, this guide will help you set up your development environment to successfully follow the instructions of the guides found in this collection.
Objectives
Install must-have tools to be productive with IBM Cloud:
- IBM Cloud CLI - the command line interface to interact with IBM Cloud API.
- Docker - to deliver and run software in packages called containers.
- kubectl - a command line interface for running commands against Kubernetes clusters.
- oc - manages OpenShift applications, and provides tools to interact with each component of your system.
- Helm 3 - helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
- Terraform - automates your resource provisioning.
- jq - a lightweight and flexible command-line JSON processor.
- Git - a free and open source distributed version control system.
To avoid the installation of these tools, you can also use the Cloud Shell from the IBM Cloud console.
Microsoft Windows
The following sections assume you are running Microsoft Windows 10 64-bit under a user with Administrator privileges. Once you're done with the specific sections, proceed to the configuration common to all operating systems.
IBM Cloud CLI
-
Download and install the IBM Cloud CLI from https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest.
-
Verify the installation with:
ibmcloud versionYou may need to restart your machine after the installation.
Docker
-
Docker Desktop on Windows is one option to run container images on Windows. Make sure to review the terms of the license agreement before proceeding with the installation.
-
If you don't have one, sign up for a free account at https://hub.docker.com/signup.
-
Download and install Docker Desktop on Windows from https://docs.docker.com/docker-for-windows/install/.
-
Verify the installation with:
docker --version docker run hello-worldYou may need to log out and wait for the Docker daemon to be started.
kubectl
- Download
kubectlfrom https://kubernetes.io/docs/tasks/tools/#install-kubectl-on-windows. - Move
kubectl.exebinary to your PATH. - Verify the installation with:
kubectl version --client=true
oc
- Download the latest 4.x OpenShift CLI (
oc) from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/. - Move
oc.exebinary to your PATH. - Verify the installation with:
oc version
Helm 3
- Download
helmfrom https://github.com/helm/helm/releases/latest. - Uncompress the downloaded archive.
- Move
helm.exebinary to your PATH. - Verify the installation with:
helm version
Terraform
- Download
terraformfrom https://developer.hashicorp.com/terraform/downloads. - Uncompress the downloaded archive.
- Move the
terraform.exebinary to your PATH. - Verify the installation with:
terraform version
To manage IBM Cloud resources with Terraform, you also need to install the IBM Cloud Provider. Starting with Terraform 0.13, the provider can be automatically downloaded from Terraform plugin registry. Follow the instructions in the provider documentation to configure the required_providers property in your Terraform templates.
jq
- Download jq from https://jqlang.github.io/jq/.
- Rename
jq-win64.exetojq.exe. - Move
jq.exebinary to your PATH. - Verify the installation with:
jq --version
Git
- Download and install
gitfrom https://github.com/git-for-windows/git/releases/latest. - Verify the installation with:
git --version
Proceed to the configuration common to all operating systems.
Apple macOS
The following sections assume you are running macOS High Sierra or later under a user with Administrator privileges. Once you're done with the specific sections, proceed to the configuration common to all operating systems.
IBM Cloud CLI
- Download and install the IBM Cloud CLI from https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest.
- Verify the installation with:
ibmcloud version
Docker
- Docker Desktop on Mac is one option to run container images on macOS. Make sure to review the terms of the license agreement before proceeding with the installation. Other options include Podman.
- If you don't have one, sign up for a free account at https://hub.docker.com/signup.
- Download and install Docker Desktop on Mac from https://docs.docker.com/docker-for-mac/install/.
- Verify the installation with:
docker --version docker run hello-world
kubectl
- Download
kubectlfrom https://kubernetes.io/docs/tasks/tools/#install-kubectl-on-macos. - Make the
kubectlbinary executable.chmod +x ./kubectl - Move the binary to your PATH.
sudo mv ./kubectl /usr/local/bin/kubectl - Verify the installation with:
kubectl version --client=true
oc
- Download the latest 4.x OpenShift CLI (
oc) from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/. - Extract
openshift-client-mac.tar.gz(Intel) oropenshift-install-mac-arm64.tar.gz(Apple Silicon):tar zxvf openshift-client-mac*.tar.gz oc - Move the
ocbinary to your PATH.sudo mv ./oc /usr/local/bin/oc - Verify the installation with:
macOS Catalina and later may prompt you with a message saying the developer cannot be verified. To allowoc versionocto be executed anyway, runsudo xattr -r -d com.apple.quarantine /usr/local/bin/oc.
Helm 3
- Download
helmfrom https://github.com/helm/helm/releases/latest. - Uncompress the downloaded archive.
- Move the
helmbinary to your PATH.sudo mv ./darwin-amd64/helm /usr/local/bin/helm - Verify the installation with:
macOS Catalina and later may prompt you with a message saying the developer cannot be verified. To allowhelm versionhelmto be executed anyway, runsudo xattr -r -d com.apple.quarantine /usr/local/bin/helm.
Terraform
- Download
terraformfrom https://developer.hashicorp.com/terraform/downloads. - Uncompress the downloaded archive.
- Move the
terraformbinary to your PATH.sudo mv ./terraform /usr/local/bin/terraform - Verify the installation with:
terraform version
To manage IBM Cloud resources with Terraform, you also need to install the IBM Cloud Provider. Starting with Terraform 0.13, the provider can be automatically downloaded from Terraform plugin registry. Follow the instructions in the provider documentation to configure the required_providers property in your Terraform templates.
jq
- Download
jqfrom https://jqlang.github.io/jq/. - Rename the downloaded file to
jq. - Make the
jqbinary executable.chmod +x ./jq - Move the
jqbinary to your PATH.sudo mv ./jq /usr/local/bin/jq - Verify the installation with:
macOS Catalina and later may prompt you with a message saying the developer cannot be verified. To allowjq --versionjqto be executed anyway, runsudo xattr -r -d com.apple.quarantine /usr/local/bin/jq.
Git
- Check that
gitis installed:
macOS may prompt you to install the developer tools. These tools include thegit --versiongitcommand line.
Proceed to the configuration common to all operating systems.
Ubuntu Linux
The following sections assume you are running Ubuntu Linux as non-root user with access to root privileges. Once you're done with the specific sections, proceed to the configuration common to all operating systems. If you are using the Linux-based Cloud Shell, proceed to the section on Cloud Shell.
IBM Cloud CLI
- Download and install the IBM Cloud CLI from https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest.
- Verify the installation with:
ibmcloud version
Docker
- If you don't have one, sign up for a free account at https://hub.docker.com/signup.
- Install Docker Engine on Ubuntu following the instructions from https://docs.docker.com/engine/install/ubuntu/.
- Verify the installation with:
To run Docker under your own user instead of root, perfom the post install steps.docker --version sudo docker run hello-world
kubectl
- Download
kubectlfrom https://kubernetes.io/docs/tasks/tools/#install-kubectl-on-linux. - Make the
kubectlbinary executable.chmod +x ./kubectl - Move the binary to your PATH.
sudo mv ./kubectl /usr/local/bin/kubectl - Verify the installation with:
kubectl version --client=true
oc
- Download the latest 4.x OpenShift CLI (
oc) from https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/. - Extract
openshift-client-linux.tar.gz:tar zxvf openshift-client-linux.tar.gz oc - Move the
ocbinary to your PATH.sudo mv ./oc /usr/local/bin/oc - Verify the installation with:
oc version
Helm 3
- Download
helmfrom https://github.com/helm/helm/releases/latest. - Uncompress the downloaded archive.
- Move the
helmbinary to your PATH.sudo mv ./linux-amd64/helm /usr/local/bin/helm - Verify the installation with:
helm version
Terraform
- Download
terraformfrom https://developer.hashicorp.com/terraform/downloads. - Uncompress the downloaded archive.
- Move the
terraformbinary to your PATH.sudo mv ./terraform /usr/local/bin/terraform - Verify the installation with:
terraform version
To manage IBM Cloud resources with Terraform, you also need to install the IBM Cloud Provider. Starting with Terraform 0.13, the provider can be automatically downloaded from Terraform plugin registry. Follow the instructions in the provider documentation to configure the required_providers property in your Terraform templates.
jq
- Install
jqwith:sudo apt install jq - Verify the installation with:
jq --version
Git
- Install
gitwith:sudo apt install git - Verify the installation with:
git --version
Proceed to the configuration common to all operating systems.
Common to all operating systems
The next sections are common to all operating systems.
IBM Cloud CLI plugins
Plugins extend the capabilities of the IBM Cloud CLI with commands specific to a service.
- Install the following plugins:
To see all the available plugins, runibmcloud plugin install container-registry ibmcloud plugin install cloud-object-storage ibmcloud plugin install kubernetes-service ibmcloud plugin install vpc-infrastructure ibmcloud plugin install code-engineibmcloud plugin repo-pluginsand to install a pluginibmcloud plugin install <PLUGIN_NAME>
GitHub account
- Sign up for a free account at https://github.com/.
- Create a new public repository at https://github.com/new to get familiar with GitHub.
IBM Cloud GitLab
IBM Cloud provides you with hosted Git repositories built on GitLab Community Edition and accessible with the same credentials used to log in IBM Cloud. It is recommended to configure your SSH public key to simplify the command line interactions with the Git repositories.
- Use these instructions to generate a new SSH key pair if you don't have one.
- Add your SSH public key to your Git settings in the region where you plan to host your Git repositories, such as Dallas (us-south.git.cloud.ibm.com), London (eu-gb.git.cloud.ibm.com) or Frankfurt (eu-de.git.cloud.ibm.com).
To verify the configuration:
- Create a new private project in GitLab, select the option to initialize the repository with a README.
- Checkout the project from the command line by cloning with the SSH link.
- Update the README file.
- Commit and push the changes.
Cloud Shell
oc
Follow these steps if you need to use another version of the OpenShift CLI than the one pre-installed:
- Download the latest stable 4.x OpenShift CLI (
oc)curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz --output oc.tar.gz - Extract
oc.tar.gz:tar zxvf oc.tar.gz oc - Add your current directory to
PATHexport PATH=$PWD:$PATH - Verify the installation with:
oc version