The fire-new installation way for Db2 Data Gate in Cloud Pak for Data 4.5.0
IBM Db2 for z/OS Data Gate blog series
By Lu Liang
As we all know, IBM Db2 Data Gate for z/OS is one base service of IBM Cloud Pak for Data (CP4D) and it makes data from Db2 for z/OS readily accessible on the CP4D platform for business users and application developers.
Since CP4D 4.0.0 release, the installation and management mechanism of CP4D is totally changed from assembly package to operator based package which relies on the Operator Lifecycle Manager (OLM) as well as some key features delivered by Cloud Pak Foundational Services (CPFS).
In CP4D 4.5.0 release, IBM introduces a fire-new installation way to help customer easily understand these changes and provides a unified user experience for its all services.
The following is the details about how to make DB2 Data Gate available in CP4D 4.5.0
CPD-CLI and olm-utils
cpd-cli is the command line interface tool of CP4D and you can download it from github. olm-utils
is a new plug-in of cpd-cli, which was delivered as one single docker or podman container in a client system (Mac, Linux or Windows). In CP4D 4.5.0 release, olm-utils as an alias manage
is imported into cpd-cli.
Prerequisites
The latest image of olm-utils iscp.stg.icr.io/cp/cpd/olm-utils:latest-validated
. In order to pull image from cp.stg.icr.io, the container runtime such as podman or docker need to be configured.
Since CP4D is installed on top of openshift cluster, the openshift client oc is also needed and configured with the OCP cluster.
Overview
cpd-cli supports a series of sub commands for CP4D. All olm-utils
supported sub commands and detailed usage can be showed by cpd-cli manage --help
./cpd-cli manage --help
[INFO] 2022-07-12T07:46:27.226764Z Checking architecture: amd64
[INFO] 2022-07-12T07:46:27.226783Z Checking podman or docker
[INFO] 2022-07-12T07:46:27.274199Z Checking container image
[DEBUG] 2022-07-12T07:46:27.422532Z 809f64175a58 cp.stg.icr.io/cp/cpd/olm-utils:latest-validated 24 minutes ago Up 24 minutes ago olm-utils-play
[INFO] 2022-07-12T07:46:27.422583Z Container olm-utils-play is running already. Image: cp.stg.icr.io/cp/cpd/olm-utils:latest-validated
[INFO] 2022-07-12T07:46:27.422595Z Showing help information
[DEBUG] 2022-07-12T07:46:27.422617Z Run command: podman exec -t olm-utils-play help-utils.shadd-cred-to-global-pull-secret
------------------------------
Update the global image pull secret to enable the cluster to pull images from
your private container registry.Syntax
------
cpd-cli manage add-cred-to-global-pull-secret <PRIVATE_REGISTRY_LOCATION> <PRIVATE_REGISTRY_PULL_USER> <PRIVATE_REGISTRY_PULL_PASSWORD>Arguments
---------
PRIVATE_REGISTRY_LOCATION
The HTTPS URL of the private container registry.
PRIVATE_REGISTRY_PULL_USER
The username of a user who has the required privileges to pull images from
the private container registry.
PRIVATE_REGISTRY_PULL_PASSWORD
The password of the user who has the required privileges to pull images from
the private container registry.Examples
--------
# Add your private container registry credentials to the global pull secret
cpd-cli manage add-cred-to-global-pull-secret https://myregistry.domain.com pull-user pull-pwd
...
Setup
Besides the above prerequisites, before running the cpd-cli command, the following environment variables are also needed.
podman login --username iamapikey --password xxxx cp.stg.icr.io
export PATH=~/cpd-cli-linux-EE-11.0.0-21:$PATH
export OLM_UTILS_IMAGE=cp.stg.icr.io/cp/cpd/olm-utils:latest-validated
export KUBEADMIN_PASS=xxxxxxxxx
export KUBEADMIN_USER=xxxxxxxxx
INFRA_NODE="x.xx.xxx.xx"
export USE_SKOPEO=true
Run the sub command login-to-ocp
to start olm-utils container. The workspace cpd-cli-workspace
is created concurrently and all logs and detailed messages are stored.
[]# cpd-cli manage login-to-ocp -u ${KUBEADMIN_USER} -p ${KUBEADMIN_PASS} --server=https://${INFRA_NODE}:6443[]# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
809f64175a58 cp.stg.icr.io/cp/cpd/olm-utils:latest-validated 32 minutes ago Up 32 minutes ago olm-utils-play[]# ls -al
total 6792
drwxr-xr-x 5 1005 1006 91 Jul 12 07:55 .
drwxr-xr-x 8 root root 4096 Jun 29 19:34 ..
drwxr-xr-x 2 1005 1006 4096 Jun 29 17:40 LICENSES
-rwxr-xr-x 1 1005 1006 6942700 Jun 29 17:26 cpd-cli
drwxr--r-- 4 root root 45 Jun 29 19:35 cpd-cli-workspace
drwxr-xr-x 5 1005 1006 48 Jun 29 17:40 plugins
Run the sub command setup-instane-ns
to configure namespaces for CP4D.
cpd-cli manage setup-instance-ns --cpd_instance_ns=cpd-instance --cpd_operator_ns=cpd-operators
- cpd-instance #the namespace for all provisioned services instance
- cpd-operator #the namespace for all installed operator
- ibm-common-services #the namespace for shared foundational services
Install Operator
Since Data Gate is one of base service of CP4D, the CP4D core service (ZEN) and Cloud Pak Foundational Services (CPFS) are also needed.
- Install foundational service operator
cpd-cli manage apply-olm --release=4.5.0 --catsrc=true --sub=true --components=cpfs -vv
2. Install core service operator
cpd-cli manage apply-olm --release=4.5.0 --catsrc=true --sub=true --components=cpd_platform --cpd_operator_ns=cpd-operators -vv
3. Install Data Gate service operator
cpd-cli manage apply-olm --release=4.5.0 --catsrc=true --sub=true -components=datagate --cpd_operator_ns=cpd-operators -vv
After the above 3 commands run successfully, these installed operators can be displayed on openshift cluster console ui as below.
Install Service
- Install service for core and foundational service
cpd-cli manage apply-cr — release=4.5.0 — components=cpfs,cpd_platform — license_acceptance=true — cpd_instance_ns=cpd-instance -v — file_storage_class=nfs-client — block_storage_class=nfs-client
2. Install service for datagate service
cpd-cli manage apply-cr — release=4.5.0 — components=db2oltp,db2wh,datagate — license_acceptance=true — cpd_instance_ns=cpd-instance -v — file_storage_class=nfs-client — block_storage_class=nfs-client
3. Check status
cpd-cli manage get-cr-status --cpd_instance_ns=cpd-instance --components=cpd_platform,datagate
Provision Data Gate Instance
After the Data Gate service is installed successfully, the Data Gate instance can be provisioned from platform UI. The detailed provision steps can be found from this blog.