Cloud Toolchain Setup
IBM Cloud Toolchain Setup
For this pattern, we will create an instance of the IBM Cloud Kubernetes Service (IKS) on VPC Gen 2. The following will work similar to Red Hat OpenShift Kubernetes Service (ROKS), as well as any Kubernetes service outside of IBM Cloud that you may have access to.
- From the IBM Cloud console, select Kubernetes from the top left navigation menu in IBM Cloud
- Click Create Cluster
- Select Kubernetes version Latest which is required for VPC Gen 2
- Select VPC Gen 2 Infrastructure (Assumes VPC Gen 2 has already been created)
- Scroll down and complete and select other options such as type and number of nodes and hit Create. Wait a few minutes for your cluster to finish provisioning before proceeding to the next step.
- Add a Namespace to the registry on IBM Cloud
$ ibmcloud cr namespace-add attworkshoptestAdding namespace 'attworkshoptest'...Successfully added namespace 'attworkshoptest'OK
- Upgrade the plan, if needed, to unlock unlimited storage for the registry.
$ ibmcloud cr plan-upgradeYou agree to the terms and conditions of the 'Standard' pricing plan when you upgrade: https://www.ibm.com/software/sla/sladb.nsf/sla/bm-7670-03You cannot undo this operation.Do you want to continue to upgrade your pricing plan? [y/N]> ySetting pricing plan: 'Standard'...OK
- From the IBM Cloud console, select Devops from the top left navigation menu in IBM Cloud
- Click the Create toolchain button
- Select the Develop a Kubernetes app tile as your template.
- Define the Toolchain Name, Region and Resource Group for the toolchain.
- For Source Provider, select Git Repos and Issue Tracking which will create a git repo space using the IBM Cloud gitlab environment
- Next, configure the git repo. Select US East for the Server, select Clone as the Repository Type and
https://github.com/jzaccone/java-liberty-appfor the Source repository URL.
Configure the Delivery Pipeline:
- Select from the dropdowns to find the container registry namespace you created earlier by selecting the appropriate Container registry region and Container registry namespace.
- Click the blue button to generate a IBM Cloud API Key based on your current logged in user.
- Use the dropdowns again to find your clustser by selecting the correct Cluster region, Resource Group, and Cluster name.
- Write in default for Cluster namespace.
- Select Create to create your Toolchain
One you create the Toolchain, you should see the following screen
Using the Deploy to Kubernetes template, we configure a few things to the toolchain out of the box.
- Git which links to a the GitLab environment hosted on IBM Cloud and protected by IAM for your accounts
- Eclipse Orion Web IDE which is a web IDE allowing you to browse and make quick edits to your code
- Issues which links to the Issues page in your source control repository
- Delivery Pipeline which includes all the stages and jobs for building, testing and deploying your application. The pipeline should have been triggered to run automatically when you created the pipeline
You can add a new tool to your tool chain by pressing the Add Tool button. Options for tools include integrations with Artifactory, Nexus, SonarQube, Slack or you can create a custom integration with any tool
Select the Delivery Pipeline tile to check the progress of your pipeline execution. Once it completes, you should see that all stages pass successfully.
You might notice that the Containerize stage passed with warnings. That is because vulnerabilities were found from the IBM Cloud Vurnerability Advisor. You can click through to see logs to see details of what vulnerabilities were discovered.
Click the Deploy to Kubernetes job in the Deploy stage. This should take you to the logs output for that job.
Near the bottom of the logs you should see a print of the address for your application.
Click on the link to see your application running on the Kubernetes Cluster on IBM Cloud
This IBM Cloud Toolchain is automatically configured to run whenever a code change is committed to the linked git repository. To see what change triggered a particular pipeline run, check the Last Input in the build stage.
Within that box, there is a link that will take you to the exact commit in the git repo where you can view what files were changed.
Once the pipeline is run multiple times, a history is created. Click on View logs and history for any stage to see a detailed history and logs for each stage execution.