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
occommand line interface by logging into your cluster:oc login -u kubeadmin -n defaultInitialize
helmcommand line interface as well:helm init --client-only --skip-refresh --tlsCreate a new namespace:
oc new-project db2Obtain 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-cephfsExecute 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=pullCreate 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_optionsfile:- 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