Enabling the hostIPC option for the cluster before deploying Db2

In some cases you might want to enable the hostIPC option for the OpenShift® cluster where you installed Db2® so that you can tune kernel parameters for worker nodes on the cluster.

About this task

The hostIPC option might be suitable for your environment when:

  • You want to use a restricted SCC.
  • You do not want to enable unsafe sysctls on the cluster.
  • You want to use the OpenShift Machine Config Operator or NodeTuning Operator to tune the worker IPC kernel parameters.

Perform this procedure after you install the Db2 service but before you deploy a Db2 database.

Procedure

  1. Set the Db2 operator replica to 0 by running the following command:
    oc patch deployment ibm-db2oltp-cp4d-operator-controller-manager --patch '{"spec": {"replicas": 0}}' -n operator_namespace

    Where operator_namespace is the OpenShift project (namespace) that contains the Db2 operator.

  2. Open the db2u-json-cm ConfigMap object in edit mode:
    oc edit cm db2u-json-cm -n=namespace
  3. Type /host-ipc to locate the host-ipc section of the ConfigMap.
  4. Under the ibm-db2oltp.json data option change host-ipc to true:
    \"host-ipc\": true
  5. Save the change and exit the ConfigMap.
  6. Delete the zen-database-core pod in order for the ConfigMap changes to be re-mounted to the volume.
    oc delete po $(oc get po -n=namespace | grep zen-database-core | awk {'print $1'}) -n=namespace
    Note: If you reinstall or upgrade the Db2 service, you must perform these steps again.
  7. Deploy the Db2 database instance.
  8. Set the Db2 operator replica to 1 by running the following command:
    oc patch deployment ibm-db2oltp-cp4d-operator-controller-manager --patch '{"spec": {"replicas": 1}}' -n cpd_operator_namespace

    Where cpd_operator_namespace is the OpenShift project (namespace) that contains the Cloud Pak for Data operator.