~/blog/Install-datastage-on-openshift
|
Published on

Install DataStage 4.7.X on OpenShift

Overview

This is a guide on installing Cloud Pak 4 Data with DataStage 4.7.X This installation assumes you have a OpenShift cluster that can accomodate the installation of Cloud Pak 4 Data and DataStage.

Prereqs:

cpd-cli:

# Install cpd-cli
wget https://github.com/IBM/cpd-cli/releases/download/v13.1.1/cpd-cli-linux-EE-13.1.1.tgz
tar zxvf cpd-cli-linux-EE-13.1.1.tgz

# Set the path on your workstation to include the location of the cp4d-cli.
# You can export this for run time or set in your .bashrc or shells rc file
export PATH=$PATH:/$HOME/cpd-cli-linux-EE-13.1.1-83

OpenShift command line (oc):

curl -L -o openshift-client-linux.tar https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-4.12/openshift-client-linux.tar.gz
sudo tar xvf openshift-client-linux.tar -C /usr/local/bin

Podman if not already installed

sudo yum update -y
sudo yum install -y podman
podman version
podman info

IBM Entitlement Key

Setting up installation environment variables

Create a vars file and input the following variables

## namespaces
export PROJECT_CERT_MANAGER=ibm-cert-manager
export PROJECT_LICENSE_SERVICE=ibm-licensing
export PROJECT_SCHEDULING_SERVICE=cpd-scheduler
export PROJECT_CPD_INST_OPERATORS=cpd-operators
export PROJECT_CPD_INST_OPERANDS=cpd-instance
## cluster info
export OPENSHIFT_TYPE="self-managed"
export OCP_URL="<your_openshift_url>"
export OCP_TOKEN="<your_openshift_token>"
export IMAGE_ARCH=amd64
## storage
export STG_CLASS_BLOCK="ocs-storagecluster-ceph-rbd"
export STG_CLASS_FILE="ocs-storagecluster-cephfs"
## entitlement key
export IBM_ENTITLEMENT_KEY="<your_ibm_entitlement_key>"
## components
export COMPONENTS=ibm-cert-manager,ibm-licensing,scheduler,cpfs,cpd_platform
## version
export VERSION="4.7.4"

Source the variable file

. vars

Installing Cloud Pak for Data 4.7.X

Update the global pull secret

# login to the clsuter if require
cpd-cli manage login-to-ocp --token=${OCP_TOKEN} --server=${OCP_URL}
# Apply the entitlement key
cpd-cli manage add-icr-cred-to-global-pull-secret --entitled_registry_key=${IBM_ENTITLEMENT_KEY}

Creating projects for Cloud Pak 4 Data

oc new-project ${PROJECT_CERT_MANAGER}
oc new-project ${PROJECT_LICENSE_SERVICE}
oc new-project ${PROJECT_SCHEDULING_SERVICE}

Install shared cluster components

# Install license and cert manager
cpd-cli manage apply-cluster-components \
--release=${VERSION} \
--license_acceptance=true \
--cert_manager_ns=${PROJECT_CERT_MANAGER} \
--licensing_ns=${PROJECT_LICENSE_SERVICE}

Install scheduling service

cpd-cli manage apply-scheduler \
--release=${VERSION} \
--license_acceptance=true \
--scheduler_ns=${PROJECT_SCHEDULING_SERVICE}

Apply CRIO (All nodes will be rebooted)

cpd-cli manage apply-crio --openshift-type=${OPENSHIFT_TYPE}

Preparing to install Cloud Pak 4 Data Instance

oc new-project ${PROJECT_CPD_INST_OPERATORS}
oc new-project ${PROJECT_CPD_INST_OPERANDS}

Apply permissions to namespaces not tethered

cpd-cli manage authorize-instance-topology \
--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}

Authorize administrator instance

export INSTANCE_ADMIN=admin
# Assign the role for the operators project for the instance
oc adm policy add-role-to-user admin ${INSTANCE_ADMIN} \
--namespace=${PROJECT_CPD_INST_OPERATORS} \
--rolebinding-name="cpd-instance-admin-rbac"
# Assign the role in the operators project for the instance
oc adm policy add-role-to-user admin ${INSTANCE_ADMIN} \
--namespace=${PROJECT_CPD_INST_OPERANDS} \
--rolebinding-name="cpd-instance-admin-rbac"

Assign the user the cpd-instance-admin-apply-olm role on the operators project for the instance:

oc apply -f - << EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: cpd-instance-admin-apply-olm
  namespace: ${PROJECT_CPD_INST_OPERATORS}
rules:
- apiGroups:
  - operators.coreos.com
  resources:
  - operatorgroups
  verbs:
  - create
  - get
  - list
  - patch
  - update
- apiGroups:
  - operators.coreos.com
  resources:
  - catalogsources
  verbs:
  - create
  - get
  - list
EOF

Assign the user the role in the operators project for the instance:

oc adm policy add-role-to-user cpd-instance-admin-apply-olm ${INSTANCE_ADMIN} \
--namespace=${PROJECT_CPD_INST_OPERATORS} \
--role-namespace=${PROJECT_CPD_INST_OPERATORS} \
--rolebinding-name="cpd-instance-admin-apply-olm-rbac"

Installing an instance of Cloud Pak for Data

Install Cloud Pak Foundational Services

Setup-instance-topology to install IBM Cloud Pak foundational services and create the required ConfigMap: non-tehtered projects

cpd-cli manage setup-instance-topology \
--release=${VERSION} \
--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--license_acceptance=true

Specify the privileges that Db2U runs

If the cluster administrator did not change the kernel parameter settings, you must allow Db2U to run with elevated privileges.

Apply elevated privileges to the configmap by applying the yml

oc apply -f - <<EOF
apiVersion: v1
data:
  DB2U_RUN_WITH_LIMITED_PRIVS: "false"
kind: ConfigMap
metadata:
  name: db2u-product-cm
  namespace: ${PROJECT_CPD_INST_OPERATORS}
EOF

Installing Cloud Pak 4 Data

cpd-cli manage get-license \
--release=${VERSION} \
--license-type=EE

Install the operators for the instance

cpd-cli manage apply-olm --release=${VERSION} --cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} --components=${COMPONENTS}

Install the operands for the instance

Install control plane only

cpd-cli manage apply-cr --release=${VERSION} --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} --components=cpd_platform --block_storage_class=${STG_CLASS_BLOCK} --file_storage_class=${STG_CLASS_FILE} --license_acceptance=true

validate the installation

cpd-cli manage get-cr-status --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}

Get URL and default credentials

cpd-cli manage get-cpd-instance-details --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} --get_admin_initial_credentials=true

Installing DataStage

export DATASTAGE_TYPE=datastage_ent_plus
or
export DATASTAGE_TYPE=datastage_ent

Install the service

cpd-cli manage apply-cr \
--components=${DATASTAGE_TYPE} \
--release=${VERSION} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--block_storage_class=${STG_CLASS_BLOCK} \
--file_storage_class=${STG_CLASS_FILE} \
--license_acceptance=true

Validate the service

cpd-cli manage get-cr-status \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=${DATASTAGE_TYPE}

Watson Pipelines

Install the oprator

cpd-cli manage apply-olm \
--release=${VERSION} \
--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
--components=ws_pipelines

Install the service

cpd-cli manage apply-cr \
--components=ws_pipelines \
--release=${VERSION} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--license_acceptance=true

Validate the service install

cpd-cli manage get-cr-status \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=ws_pipelines