How To
Summary
In 21.0.3-IF012 and 22.0.1-IF002, a new shell script (cp4a-prerequisites.sh) is provided in the cert-kubernetes archive of the CASE package to help you prepare for an installation of Cloud Pak for Business Automation (CP4BA). The script generates property files for the selected capabilities in your deployment. Based on the input provided by you in the property files, the script will then generate the necessary database scripts along with the YAML templates for Kubernetes secrets. You would then leverage the database scripts and YAML templates to create the necessary databases and the Kubernetes secrets needed for the selected capabilities.
Objective
- The first mode is "property":
- Creates the user property files:
- cp4ba_db_name_user.property,
- cp4ba_db_server.property, and
- cp4ba_LDAP.property
- Creates the user property files:
- The second mode is "generate":
- Uses the generated property files to create the DB SQL statement file and the YAML template for the secret.
Script location
./cp4a-prerequisites.sh
Usage: cp4a-prerequisites.sh -m [modetype]
Options:
-h Display help
-m The valid mode type: [property] or [generate]
STEP1: run with [property] mode: create user property file (DB/LDAP property file) with default value (database name/user).
STEP2: Modify DB/LDAP/User property file as your requirement.
STEP3: run with [generate] mode: generate DB SQL statement file/YAML template for secret automatically based on the value in property file.
Steps
- Run the script in the "property" mode:
./cp4a-prerequisites.sh -m property
The following message appears:[INFO] Please input correct value in property file under /root/git/22.0.1/cert-kubernetes/scripts/cp4ba-prerequisites/propertyfile
The /propertyfile directory has the following structure:├── cert │ ├── db │ └── ldap ├── cp4ba_db_name_user.property ├── cp4ba_db_server.property └── cp4ba_LDAP.property
-
You must then edit the three files cp4ba_db_name_user.property, cp4ba_db_server.property, and cp4ba_LDAP.property with the values in your environment. Update the files with LDAP and Database information.
-
After you updated the user property files, run the cp4a-prerequisites.sh script in the "generate" mode.
./cp4a-prerequisites.sh -m generate
You see the following messages at the end of the execution:[INFO] The DB SQL statement files for CP4BA are in directory /root/git/22.0.1/cert-kubernetes/scripts/cp4ba-prerequisites/dbscript, you could modify or use default setting to create database. (PLEASE DO NOT CHANGE DBNAME/DBUSER/DBPASSWORD DIRECTLY) ... [INFO] Please input correct value in YAML template for secret under /root/git/22.0.1/cert-kubernetes/scripts/cp4ba-prerequisites/secret_template
The /cp4ba-prerequisites directory has the following structure and varies depending on the capabilities that you selected when you ran the script:├── dbscript │ ├── ae │ │ └── db2 │ │ └── create_app_engine_db.sql │ ├── ban │ │ └── db2 │ │ └── createICNDB.sql │ ├── baw-aws │ │ └── db2 │ │ ├── create_baw_db_instance1_for_baw.sql │ │ └── create_baw_db_instance2_for_aws.sql │ ├── fncm │ │ └── db2 │ │ ├── createAEOS.sql │ │ ├── createAWSDOCS.sql │ │ ├── createBAWDOCS.sql │ │ ├── createBAWDOS.sql │ │ ├── createBAWTOS.sql │ │ ├── createGCDDB.sql │ │ ├── createOS1DB.sql │ │ ├── createOS2DB.sql │ │ └── createOS3DB.sql │ └── odm │ └── db2 │ └── createODMDB.sql └── secret_template ├── ads │ └── ibm-dba-ads-mongo-secret.yaml ├── ae │ └── ibm-aae-app-engine-secret.yaml ├── ban │ └── ibm-ban-secret.yaml ├── baw │ └── ibm-baw-db-secret.yaml ├── baw-aws │ └── icp4a-shared-encryption-key-secret.yaml ├── cp4ba_db_ssl_secret │ └── ibm-cp4ba-db-ssl-cert-secret.sh ├── cp4ba_ldap_ssl_secret │ └── ibm-cp4ba-ldap-ssl-cert-secret.sh ├── fncm │ ├── ibm-fncm-iccsap-secret.yaml │ ├── ibm-fncm-icc-secret.yaml │ ├── ibm-fncm-ier-secret.yaml │ └── ibm-fncm-secret.yaml ├── ibm-ldap-bind-secret.yaml └── odm └── ibm-odm-db-secret.yaml
-
After you generated these files, check and update the DB scripts and the YAML templates.
-
When you are ready you can then run the DB scripts against your database server and use the YAML templates to create the necessary secrets in your OpenShift Container Platform cluster. For example, to run the DB .sql script on your database server, run the sqlplus command and provide your user's credentials:
sqlplus @createAEOS.sql
To create the secret with the edited YAML, run the following command:
oc create -f ibm-odm-db-secret.yaml
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
12 December 2022
UID
ibm16616615