Setting up installation environment variables (Upgrading from Version 4.0 to Version 4.6)
The commands for installing and upgrading IBM Cloud Pak® for Data use variables with the format
${VARIABLE_NAME}
. You can create a script to automatically export the appropriate
values as environment variables before you run the installation commands. After you source the
script, you will be able to copy most install and upgrade commands from the documentation and run
them without making any changes.
- Upgrade phase
- Setting up a client workstation
- Who needs to complete this task?
- Any users who will run installation or upgrade commands that require information about your environment, such as information about your Red Hat® OpenShift® Container Platform cluster or your private container registry.
- When do you need to complete this task?
- You should complete this task before you start preparing your cluster.
Before you begin
If you created one or more scripts when you installed IBM Cloud Pak for Data Version 4.0, you can edit your existing scripts.
- Repeatable deployments across clusters
- In this scenario, you can re-use the same script to improve the consistency of deployments across your environments.
- Multiple deployments on the same cluster
- In this scenario, you can create multiple scripts to simplify the process of managing each instance. Clearly name each script to ensure that you run the correct script before you run the installation or upgrade commands.
Creating an environment variables file
- Copy the following example to a text editor on your local file
system:
#=============================================================================== # Cloud Pak for Data installation variables #=============================================================================== # ------------------------------------------------------------------------------ # Client workstation # ------------------------------------------------------------------------------ # export CPD_CLI_MANAGE_WORKSPACE=<enter a fully qualified directory> # export OLM_UTILS_LAUNCH_ARGS=<enter launch arguments> # ------------------------------------------------------------------------------ # Cluster # ------------------------------------------------------------------------------ export OCP_URL=<enter your Red Hat OpenShift Container Platform URL> export OPENSHIFT_TYPE=<enter your deployment type> export IMAGE_ARCH=<enter your cluster architecture> # export OCP_USERNAME=<enter your username> # export OCP_PASSWORD=<enter your password> # export OCP_TOKEN=<enter your token> # ------------------------------------------------------------------------------ # Projects # ------------------------------------------------------------------------------ export PROJECT_CPFS_OPS=ibm-common-services export PROJECT_CPD_OPS=<enter your Cloud Pak for Data operator installation project> export PROJECT_CATSRC=openshift-marketplace export PROJECT_CPD_INSTANCE=<enter your Cloud Pak for Data installation project> # export PROJECT_TETHERED=<enter the tethered project> # ------------------------------------------------------------------------------ # Storage # ------------------------------------------------------------------------------ export STG_CLASS_BLOCK=<RWO-storage-class-name> export STG_CLASS_FILE=<RWX-storage-class-name> # ------------------------------------------------------------------------------ # IBM Entitled Registry # ------------------------------------------------------------------------------ export IBM_ENTITLEMENT_KEY=<enter your IBM entitlement API key> # ------------------------------------------------------------------------------ # Private container registry # ------------------------------------------------------------------------------ # Set the following variables if you mirror images to a private container registry. # # To export these variables, you must uncomment each command in this section. # export PRIVATE_REGISTRY_LOCATION=<enter the location of your private container registry> # export PRIVATE_REGISTRY_PUSH_USER=<enter the username of a user that can push to the registry> # export PRIVATE_REGISTRY_PUSH_PASSWORD=<enter the password of the user that can push to the registry> # export PRIVATE_REGISTRY_PULL_USER=<enter the username of a user that can pull from the registry> # export PRIVATE_REGISTRY_PULL_PASSWORD=<enter the password of the user that can pull from the registry> # ------------------------------------------------------------------------------ # Cloud Pak for Data version # ------------------------------------------------------------------------------ export VERSION=4.6.6 # ------------------------------------------------------------------------------ # Components # ------------------------------------------------------------------------------ # Set the following variable if you want to install or upgrade multiple components at the same time. # # To export the variable, you must uncomment the command. # export COMPONENTS=cpfs,scheduler,cpd_platform,<component-ID>
- Update each section in the script for your environment. See the following sections to learn about the variables and valid values in each section of the script:
- Save the file as a shell script. For example, save the file as
cpd_vars.sh
. - Confirm that the script does not contain any errors. For example, if you
named the script
cpd_vars.sh
, run:bash ./cpd_vars.sh
- If you stored passwords in the file, prevent others from reading the file.
For example, if you named the script
cpd_vars.sh
, run:chmod 700 cpd_vars.sh
Sourcing the environment variables
Save a copy of the script to your workstation and run it from a bash prompt before you the run installation and upgrade commands. The script exports the environment variables to your command-line session.
- Change to the directory where you saved the script.
- Source the environment variables. For example, if you named the script
cpd_vars.sh
, run:source ./cpd_vars.sh
Cluster
The variables in the Cluster section of the script specify information about your Red Hat OpenShift Container Platform cluster.
Variable | Description |
---|---|
OCP_URL |
The URL of the Red Hat
OpenShift Container Platform server. For example,
https://openshift1.example.com:8443.
|
OPENSHIFT_TYPE |
The type of Red Hat
OpenShift Container Platform cluster that you are
running.
|
IMAGE_ARCH |
The architecture
of your Red Hat
OpenShift Container Platform Cluster
hardware.
|
OCP_USERNAME |
The username that you use to authenticate to your cluster. You must have sufficient
privileges to complete each installation or upgrade task. This variable is used to run the
Tip: It is
recommended that you prevent other users from reading the contents of the environment variable
script by running
chmod 700 . However, if you still have concerns about storing your
OpenShift credentials in this file, you can:
Remember: You must uncomment the
export OCP_USERNAME command if you want to use this environment
variable. |
OCP_PASSWORD |
The password that you use to authenticate to your
cluster. Remember: You must uncomment the
export
OCP_PASSWORD command if you want to use this environment
variable. |
OCP_TOKEN |
Remember: You must uncomment the
export OCP_TOKEN command if you want to use this environment variable.You can optionally use a token instead of your user name and password to log in to your Red Hat OpenShift Container Platform cluster. You can get your token from the Red Hat OpenShift Container Platform web console. From the username drop-down menu, select Copy login command. When prompted, click Display Token. |
Projects
The variables in the Projects section of the script specify where the components that comprise Cloud Pak for Data are installed.
Variable | Description |
---|---|
PROJECT_CPFS_OPS |
The Red Hat
OpenShift project where the
IBM
Cloud Pak foundational services operators are installed.
|
PROJECT_CPD_OPS |
The Red Hat
OpenShift project where the
Cloud Pak for Data software operators are installed.
|
PROJECT_CATSRC |
The Red Hat
OpenShift project where the
catalog sources are installed.
|
PROJECT_CPD_INSTANCE |
The Red Hat
OpenShift project where the
Cloud Pak for Data control
plane and services are installed.
(The Cloud Pak for Data control
plane is installed in a
separate project from the operators.)
Tip: If you want to install multiple instances of Cloud Pak for Data on your cluster, create a separate script for
each instance that you plan to install.
|
PROJECT_TETHERED |
A Red Hat
OpenShift project that is
tethered to the project where the Cloud Pak for Data
control plane is installed. This variable is required only if you plan to install a service that supports tethering into a tethered project. Remember: You must uncomment the
export PROJECT_TETHERED command if you want to use this
environment variable.
|
Storage
The variables in the Storage section of the script specify the storage classes that the installation should use.
Variable | Description |
---|---|
STG_CLASS_BLOCK
|
The name of a
block storage class on a supported storage option.
|
STG_CLASS_FILE |
The name of a file
storage class on a supported storage option.
|
IBM Entitled Registry
The variables in the IBM Entitled Registry section of the script enable you to connect to the IBM Entitled Registry and access the Cloud Pak for Data software images that you are entitled to.
Depending on whether you pull images from the IBM Entitled Registry or from a private container registry, the variables might also be used to configure the global image pull secret.
Variable | Description |
---|---|
IBM_ENTITLEMENT_KEY |
The entitlement
API key that is associated with your My IBM
account.
|
Private container registry
It is strongly recommended that you use a private container registry. The variables in the Private container registry section are required only if you mirror images to a private container registry.
The variables in the Private container registry section of the script enable you to mirror images from the IBM Entitled Registry to the private container registry.
Variable | What to specify |
---|---|
PRIVATE_REGISTRY_LOCATION |
The location of the private container registry.
|
PRIVATE_REGISTRY_PUSH_USER |
The username of a user who has the required privileges to push images to the private
container registry.
|
PRIVATE_REGISTRY_PUSH_PASSWORD |
The password of the user who has the required privileges to push images to the
private container registry. Tip: It is recommended that you prevent
other users from reading the contents of the environment variable script by running
chmod
700 . However, if you still have concerns about storing passwords in this file, you can:
|
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. Tip: It is recommended that you prevent
other users from reading the contents of the environment variable script by running
chmod
700 . However, if you still have concerns about storing passwords in this file, you can:
|
Cloud Pak for Data version
The variable in the Cloud Pak for Data version section specifies which version of Cloud Pak for Data to install or upgrade to.
Variable | Description |
---|---|
VERSION |
The version of the Cloud Pak for Data software
to install.
|
Components
If you want to install or upgrade multiple components at the same time, you can specify a comma separated list of components. The variable in the Components section is recommended to help you easily specify the list of components.
Variable | Description |
---|---|
COMPONENTS |
The comma separated list of the components that you want to install or upgrade.
|