Install IBM DB2 relational database on Openshift
DB2 installation guide on Openshift for demo and lab environment
Author(s): Tamas Bures | Created: 15 July 2020 | Last modified: 15 July 2020
Tested on: Red Hat OpenShift Platform v 4.3.24 & IBM DB2 11.5.4
Install IBM DB2 relational database on Openshift
In this guide, I will demonstrate how to install IBM DB2 11.5.4 on Red Hat OpenShift Container Platform 4.3.24 (OCP) .
-
Initialize
oc
command line interface by logging into your cluster:oc login -u kubeadmin -n default
-
Initialize
helm
command line interface as well:helm init --client-only --skip-refresh --tls
-
Create a new namespace:
oc new-project db2
-
Obtain an API token for IBM Container Registry
-
Configure shell variables, makes easier the following commands:
export PROJECT=db2 export APIKEY=<obtained API key> export RELEASE_NAME=db2ocp # Will be used for DB2 instance user and ldap user password export PASSWORD=password # MUST BE BLOCK TYPE storage class export SC_CLASS=ocs-storagecluster-cephfs
-
Execute DB2 installation prerequisites
pre-install/clusterAdministration/createSecurityClusterPrereqs.sh pre-install/namespaceAdministration/createSecurityNamespacePrereqs.sh ${PROJECT}
-
Create registry access secrets:
oc create secret docker-registry ibm-registry --docker-server=icr.io --docker-username=iamapikey --docker-password=${APIKEY} oc secrets link db2u ibm-registry --for=pull
-
Create DB2 secrets:
oc create secret generic ${RELEASE_NAME}-db2u-ldap-bluadmin --from-literal=password="${PASSWORD}" oc create secret generic ${RELEASE_NAME}-db2u-instance --from-literal=password="${PASSWORD}"
-
Edit the
helm_options
file:- update/add:
global.nodeLabel.value=db2node
- update/add:
hadr.enabled="false"
- update/add:
rest.enabled="true"
- update/add:
-
Add the following label to the nodes where to you want to install db2 services
icp4data=<value set in helm_options file at option 'global.nodeLabel.value'>
-
Start installation:
cd common ./db2u-install --db-type db2oltp --namespace ${PROJECT} --release-name ${RELEASE_NAME} --storage-class ${SC_CLASS} --tls --helm-opt-file helm_options --accept-eula