heidloff.net - Building is my Passion
Post
Cancel

Setting up OpenShift and Applications in one Hour

With IBM TechZone Deployer OpenShift can be set up on multiple clouds including custom applications by using automation via Terraform and Argo CD.

ZechZone Deployer Introduction

In my previous blog I explained the TechZone Deployer aka IBM’s Toolkit: Introducing IBM’s Toolkit to handle Everything as Code. The toolkit leverages Terrafrom and GitOps and is based on best practices based on IBM’s deployment experiences from partner and client projects.

Module Catalog

Let’s take a look how the toolkit can be used. The module catalog provides 200+ modules to install IBM Software and open source components which can be deployed on clouds like AWS, Azure and IBM Cloud.

image

Bill of Materials

Complete stack solutions are defined in yaml files. These bill of materials contain list of modules, in this example OpenShift in the IBM Cloud, Argo CD including a GitOps repo, the Watson NLP (natural language processing) container and a custom application.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
apiVersion: cloudnativetoolkit.dev/v1alpha1
kind: BillOfMaterial
metadata:
  name: cluster-with-watson-nlp
spec:
  modules:
    - name: ibm-ocp-vpc
      version: v1.16.0
    - name: argocd-bootstrap
      version: v1.12.0
    - name: gitops-repo
      alias: gitops_repo
      version: v1.22.2
    - name: terraform-gitops-ubi
      alias: terraform_gitops_ubi
      version: v0.0.8
    - name: terraform-gitops-watson-nlp
      alias: terraform_gitops_watson_nlp
      version: v0.0.80

The modules can be configured via variables, for example regions, resource group names, sizes of clusters, etc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
variables:
  # overall
  - name: region
    description: The IBM Cloud region where the instance should be provisioned
    value: xxx
  - name: resource_group_name
    description: The name of the IBM Cloud resource group where the resources should be provisioned
    value: xxx
  # ocp
  - name: worker_count
    description: The number of workers that should be provisioned per subnet
    value: 2
  - name: cluster_flavor
    description: The flavor of the worker nodes that will be provisioned
    value: bx2.4x16

TechZone Deployer CLI

To run the sample, you need to clone the repo and install the toolkit’s CLI, called iascable.

1
2
curl -sL https://iascable.cloudnativetoolkit.dev/install.sh | sh
git clone https://github.com/IBM/watson-automation

With the CLI the bill of material is converted into Terraform assets.

1
2
3
cd watson-deployments/roks-new-nlp 
iascable build -i bom.yaml
cd output

An image is provided which comes with all tools necessary to run Terraform. To start the container, invoke this command in a terminal:

1
./launch.sh

In the running container invoke these commands:

1
2
cd cluster-with-watson-nlp
./apply.sh

The ‘apply’ command takes roughly 45 minutes to set up the managed OpenShift cluster in the IBM Cloud and the additional modules.

Result

After this, you can find the resources in the IBM Cloud console.

Argo CD has been set up to deploy the Watson NLP container and the custom application.

image

What’s next?

To find out more about the toolkit, check out the documentation and the sample above.

Featured Blog Posts
Disclaimer
The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.
Contents
Trending Tags