“How to automate deployment?”
IBM Cloud Pak for Business Automation (CP4BA) Operators
AUTHOR
Brahm Singh, IBM Automation Architect.
Ecosystem Engineering – GSI Lab (ISL Ahmedabad)
Email – brahm.singh@ibm.com
Special thanks to my manager Mukesh Verma(mverma17@in.ibm.com) who helped and motivated me to write this blog.
ABSTRACT
These days automation development and deployment automation are much needed and evolving as a common process in IT & Software industry. Every industry wants to automate its daily tasks, activities, and operations and focus more on quality and other futuristic stuff.
In software world, development operation (DevOps) team wants to automate their repeated deployment tasks using modern technologies like Containerization deployment with help of Kubernetes, docker, etc.
In the same fashion, we have Cloud Pak for Business Automation (CP4BA) automation deployment which provides a better and smooth platform where DevOps or even Dev team can deploy their capabilities with help of automation techniques.
In CP4BA deployment, we have a hybrid cloud deployment feature which makes it more powerful rather than other competitors. We leverage OpenShift Cloud platform (PaaS) to perform the deployment task for CP4BA.
INTENDED AUDIENCE
This blog is intended for Developers and Architects who deal (or will deal) with any of the following situations:
· Developers planning to move to a career in IT Architecture
· Architects involved with defining solution architecture
· Professionals involved in Pre‐sales and Solution proposals
INTRODUCTION
CP4BA automation deployment required a few steps to deploy over any cloud like IBM Cloud, AWS, and Azure with help of an automation script. In CP4BA automation deployment we generally start with Operators.
IBM CP4BA helps to automate business operations with an integrated platform of automation capabilities. The platform relies on Kubernetes, which is open-source application container orchestration software that makes it easier to configure, deploy, and manage containerized applications. It is designed to help all types of projects small and large, improve employee productivity, and deliver better end-to-end customer journeys while you reduce the burden of governing your content and processes. It can increase your ability to scale and do more work faster and better.
Image Credits: IBM CP4BA
OPERATORS
In general, term Operators take human operational knowledge and encode it into software that is more easily shared with consumers. Operators are pieces of software that ease the operational complexity of running another piece of software.
If we define operators technically, they are a method of packaging, deploying, and managing a Kubernetes application. They act like an extension of the software vendor’s engineering team, monitoring a Kubernetes environment (such as OpenShift Container Platform) and using its current state to make decisions in real time.
Image Credits: IBM Cloud Pak for Business Automation
INSTALLATION & CONFIGURATIONS
We should have a pre-requisition for CP4BA before automation.
Tools & Software Used for CP4BA Operator Installation
Cloud Account– IBM Cloud, AWS, Azure with administrator privileges.
· VPC Cluster Gen2 with ODF/OCS storage.
· Basic understanding of RedHat OpenShift Web Console to monitor automation deployment process.
· GitHub Repository with Git Token
· GitOps tools like – ArgoCD, Terraform etc.
· Basic understanding of Helm Chart
· Custom Resource Definition (CRDs) configuration template for a specific operator
· LDAP Server – Open LDAP/ Tivoli directory server or MS active server
· Database – IBM DB2
· Text Editor like Visual Studio Code
System Requirements
Size |
Non-Production |
Production |
Small |
3 Worker Node |
8 Worker Node |
Medium |
3 Worker Node |
16 Worker Node |
Large |
3 Worker Node |
32 Worker Node |
CP4BA Operators Installation Process
We can install operators in CP4BA with the following options
· One Click operator installation
· Manual Installation
· Automation via GitOps
One Click Operators Installation
The basic need for one-click installation is we should have a cluster and a project created inside this. We need to perform the following steps for one-click operators’ installation
Login into an IBM Cloud Account and select the specific cluster account where we need to install operators.
· Open an IBM OpenShift web console and create a new project like cp4ba.
· Click on the Catalog option from the Cloud account menu and search Cloud Pak for Business Automation and then select the latest version of CP4BA --> Choose
your specific cluster --> Select project from the dropdown --> to run the preinstallation script and wait till to successful completion of the script.
· Configure the workspace options like name, resource group, location, and tags.
· Set the value true for which capability you want to install like deployODM, deployBAW set true.
· Accept the license and agreement and finally click on to Install button to initiate operator installation of CP4BA.
Manual Installation
In the manual installation, perform the following steps:
· Login into an IBM Cloud Account and select the specific cluster account where we need to install operators.
· Open an IBM OpenShift web console and create a new project like cp4ba
· Create pre-requisition secret i.e., admin.registrykey and ibm-entitlement-key
· Create pre-requisition PVC’s i.e., cp4a-shared-log-pvc and operator-shared-pvc
· We should also make sure automation catalog-source needs to present inside the operator hub
· We need to choose CP4BA operator from operator hub and install it into a specific project i.e., cp4ba
· We need to apply our CR’s subscription yaml file inside CP4BA operator
· We need to wait and monitor till all operators are installed properly and verify the installation after access-info from Configmaps section where installed
operators link should be there with credentials
Automation Installation – In automation installation, we can automate the deployment of operators using a local machine or GitHub actions.
Installation & configuration setup guidelines on the local machine
· Install Docker Desktop App — https://docs.docker.com/desktop/
· Create an account into Docker — https://www.docker.com/
· Install Visual Studio Code — https://code.visualstudio.com/download
· Should have a GitHub account if not then need to be created.
· Should have an account on IBM Cloud if not then need to be created.
· Create or use the existing OpenShift Cluster.
· Open OpenShift Web Console to monitor deployment activity on OpenShift.
· Install yq4 (Optional) on the local machine
· Install LDAP Browser on local machine (Optional) http://www.ldapadmin.org/download/index.html
· Install helm on the local machine.
· Install Kubeseal(Optional) - brew install kubeseal
· Base Code download related component or module like ODM from https://github.com/cloud-native-toolkit
· Open source code into Visual studio code.
· Add a file and configure terraform.tfvars with GitHub account details, TechZone details with following params like ibmcloud_api_key (Fetch from IBM Cloud account), server_url (Cluster URL), namespace (project name or namespace which is created inside cluster), login_token (IBM Cluster OpenShift login token), git_org (GitHub Organization), git_repo (GitHub Repository), git_username (GitHub Username), git_token (GitHub personal token), cp_entitlement_key (Fetch from IBM Cloud account).
· Docker status should be running before proceeding to the next step 16.
· Open a new terminal inside the visual studio code and run the below command to get the docker image
· docker run -it -v ${PWD}:/terraform -w /terraform quay.io/cloudnativetoolkit/cli-tools:v1.4.0-v1.1
· Change the folder cd test/stage to perform further actions or steps.
· Create Soft Link for Module inside the test/stage folder TechZone environment deployment - https://github.com/dimallya/swe-local-execution-guide
· After mounting the docker image, we need to go test/stage folder and enter the below commands one by one.
– terraform init command initiates the process and downloads the required
and ready for next step i.e. terraform plan.
– terraform plan command to make sure all required components are ready and
show the console and item counts before terraform apply.
– terraform apply, the final command to deploy the code on GitHub Repo and
communicate with related cluster and apply the changes like create
namespace and try to install operators etc.
Installation & configuration setup guidelines for GitHub Actions
· Should have a GitHub account if not then need to be created.
· Should have an account on IBM Cloud if not then need to be created.
· Create or use the existing OpenShift Cluster.
· Open OpenShift Web Console to monitor deployment activity on OpenShift.
· Base Code download related component or module like ODM from https://github.com/cloud-native-toolkit
· Open source code into Visual studio code.
· Configure GitHub action same details as mentioned in step 14 (Installation & configuration setup guidelines on the local machine)
· Configure the test case name inside the .github folder --> workflow(folder) --> verify.yaml file.
· We also need to configure the GitHub folder --> script (folder) --> validate-deploy.yaml file with the following parameters like Server URL, Namespace, etc.
· We need to configure CRD inside Chart(folder) templates (folder) subscription.yaml file with all features like operator capabilities, dependencies, storage classes, secrets, etc.
· We need to configure main.tf as per operator need.
· After all configuration we need to push and commit our code to specific GitHub Repo then GitHub action auto-triggered and deploy the CP4BA operator.
References:
· https://www.ibm.com/docs/en/cloud-paks/cp-biz-automation/21.0.3?topic=overview-what-is-cloud-pak-business-automation
· https://www.ibm.com/docs/en/cloud-paks/cp-biz-automation/21.0.3?topic=ppd-system-requirements
· https://www.ibm.com/docs/en/cloud-paks/cp-biz-automation/21.0.3?topic=operator-preparing-storage-cloud-public-roks
· https://learn.hashicorp.com/tutorials/terraform/init?in=terraform/cli
Other Useful Blogs
CP4BA Deployment Methodologies – IBM Cloud & TechZone Part-1 (Manual)
Manual Installation
CP4BA Deployment Methodologies – IBM Cloud & TechZone Part-2 (Automation Script)
Automation Script