Setting up environment variables for a remote physical location
The commands for setting up a remote physical location for 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 required commands. After you source the script,
you will be able to copy most of the required commands from the documentation and run them without
making any changes.
- Who needs to complete this task?
-
Cloud Pak for Data operations team The IBM Cloud Pak for Data operations team should work with the remote cluster administrator to compile information about the remote cluster where the agents will be installed.
This information should be shared with any users who will run setup commands that require information about the remote cluster.
- When do you need to complete this task?
-
Repeat as needed Create an environment variable script for each remote physical location that you plan to set up.
Creating an environment variables file
- Copy the following example to a text editor on your local file
system:
#=============================================================================== # Remote physical location variables #=============================================================================== # ------------------------------------------------------------------------------ # Primary cluster (hub) # ------------------------------------------------------------------------------ export CPD_HUB_URL=<your Cloud Pak for Data route> export CPD_HUB_API_KEY=<your base-64 encoded API key> # ------------------------------------------------------------------------------ # Remote cluster # ------------------------------------------------------------------------------ export REMOTE_OCP_URL=<enter your Red Hat OpenShift Container Platform URL> export REMOTE_IMAGE_ARCH=<enter your cluster architecture> # export REMOTE_OCP_USERNAME=<enter your username> # export REMOTE_OCP_PASSWORD=<enter your password> # export REMOTE_OCP_TOKEN=<enter your token> export REMOTE_SERVER_ARGUMENTS="--server=${REMOTE_OCP_URL}" # export REMOTE_LOGIN_ARGUMENTS="--username=${REMOTE_OCP_USERNAME} --password=${REMOTE_OCP_PASSWORD}" # export REMOTE_LOGIN_ARGUMENTS="--token=${REMOTE_OCP_TOKEN}" export REMOTE_CPDM_OC_LOGIN="cpd-cli manage login-to-ocp ${REMOTE_SERVER_ARGUMENTS} ${REMOTE_LOGIN_ARGUMENTS}" export REMOTE_OC_LOGIN="oc login ${REMOTE_OCP_URL} ${REMOTE_LOGIN_ARGUMENTS}" # ------------------------------------------------------------------------------ # Remote projects # ------------------------------------------------------------------------------ export REMOTE_PROJECT_CERT_MANAGER=<enter your certificate manager project> export REMOTE_PROJECT_LICENSE_SERVICE=<enter your License Service project> export REMOTE_PROJECT_SCHEDULING_SERVICE=<enter your scheduling service project> export REMOTE_PROJECT_MANAGEMENT=<enter your management project> export REMOTE_PROJECT_WORKLOAD=<enter your workload project> # ------------------------------------------------------------------------------ # Remote storage # ------------------------------------------------------------------------------ export REMOTE_STG_CLASS_BLOCK=<RWO-storage-class-name> export REMOTE_STG_CLASS_FILE=<RWX-storage-class-name> # ------------------------------------------------------------------------------ # Image pull secret # ------------------------------------------------------------------------------ export REMOTE_PULL_SECRET=<your secret name> # ------------------------------------------------------------------------------ # Remote physical location # ------------------------------------------------------------------------------ export REMOTE_PHYSICAL_LOCATION_ID=<unique ID> export REMOTE_PHYSICAL_LOCATION_DISPLAY_NAME="<display-name>" # export REMOTE_PHYSICAL_LOCATION_DESCRIPTION="<description>" # export REMOTE_PHYSICAL_LOCATION_REGION=<geographic location> # export REMOTE_PHYSICAL_LOCATION_MAX_CPU=<maxium vCPU to use> # export REMOTE_PHYSICAL_LOCATION_MAX_MEMORY=<maximum memory to use>
- 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
remote_location_vars.sh
. - Confirm that the script does not contain any errors. For example, if you named the script
remote_location_vars.sh
, run:bash ./remote_location_vars.sh
- If you stored passwords in the file, prevent others from reading the file. For example, if you
named the script
remote_location_vars.sh
, run:chmod 700 remote_location_vars.sh
# ------------------------------------------------------------------------------
# Remote physical location scripts
# ------------------------------------------------------------------------------
# Information about remote physical location <name> is stored in the following
# environment variable script:
# /path-to-file/filename.txt
Adding this information to your installation environment variables script helps you keep track of the remote physical locations that are connected to your primary Cloud Pak for Data deployment, also called the hub.
Sourcing the environment variables
Save a copy of the script to your workstation and run it from a bash prompt before you the run remote physical location setup 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:
- Source your installation environment variables. For example, if you named the script
cpd_vars.sh
, run:source ./cpd_vars.sh
- Source your remote physical location environment variables. For example, if you named the script
remote_location_vars.sh
, run:source ./remote_location_vars.sh
- Source your installation environment variables. For example, if you named the script
Primary cluster (hub)
The variables in the Primary cluster (hub) section of the script specify information about the instance of IBM Cloud Pak for Data that you want to connect to from the remote physical location.
Variable | Description |
---|---|
CPD_HUB_URL
|
The route of the
primary instance of Cloud Pak for Data that you want to connect
to.
|
CPD_HUB_API_KEY |
Your base-64
encoded API key for the primary instance of Cloud Pak for Data that you want to connect
to. You must specify the platform API key of a IBM Cloud Pak for Data user with the Manage physical
location ( For more information, see Generating API keys for authentication.
|
Remote cluster
The variables in the Remote cluster section of the script specify information about the remote Red Hat® OpenShift® Container Platform cluster where you want to create a remote physical location.
chmod 700
. However, if you
still have concerns about storing your OpenShift credentials in this file, you can:- Enter the credentials directly instead of using the environment variable in the commands.
- Manually export the credentials before you run the commands.
Variable | Description |
---|---|
REMOTE_OCP_URL |
The URL of the remote Red
Hat
OpenShift Container Platform cluster where you want to
create a remote physical location. For example,
https://openshift1.example.com:8443.
|
REMOTE_IMAGE_ARCH |
The architecture
of the remote cluster hardware.
|
REMOTE_OCP_USERNAME |
The username that you use to authenticate to the remote cluster where
you want to create a remote physical location. You must have sufficient privileges to complete the
task. To use the |
REMOTE_OCP_PASSWORD |
The password that you use to authenticate to the remote cluster where
you want to create a remote physical location. To use the |
REMOTE_OCP_TOKEN |
The token that you use to authenticate to the remote cluster where
you want to create a remote physical location. You can 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. To use the |
REMOTE_SERVER_ARGUMENTS |
The server
argument to pass to log in to the remote cluster. Do not modify this The |
REMOTE_LOGIN_ARGUMENTS |
The credential
arguments to pass to log in to the remote cluster. The
REMOTE_LOGIN_ARGUMENTS environment variable depends on the credentials that
you use to log in.
|
REMOTE_CPDM_OC_LOGIN |
Shortcut for the cpd-cli
manage
login-to-ocp command for the remote cluster.Do not modify this
The
REMOTE_CPDM_OC_LOGIN
environment variable depends on the following environment variables:
|
REMOTE_OC_LOGIN |
Shortcut for the oc login command for the remote cluster.Do not modify
this The
OC_LOGIN
environment variable depends on the following environment variables:
|
Remote projects
The variables in the Remote projects section of the script specify where the components that are required to create a remote physical location are installed.
Variable | Description |
---|---|
REMOTE_PROJECT_CERT_MANAGER |
The project for the Certificate Manager operator on the remote
cluster.
|
REMOTE_PROJECT_LICENSE_SERVICE |
The project for the Licensing Service operator on the remote
cluster.
|
REMOTE_PROJECT_SCHEDULING_SERVICE |
The project for the scheduling service on the remote
cluster.
|
REMOTE_PROJECT_MANAGEMENT |
The project for the agents, operators, and custom resources for a
remote physical location.
|
REMOTE_PROJECT_WORKLOAD |
The project for workloads for a remote physical
location.
|
Remote storage
The variables in the Remote storage section of the script specify the storage classes that are available on the remote cluster.
Variable | Description |
---|---|
REMOTE_STG_CLASS_BLOCK
|
The name of a
block storage class on the remote cluster where you want to create a remote physical location. The
storage class must be associated with a supported storage option.
|
REMOTE_STG_CLASS_FILE |
The name of a file
storage class on the remote cluster where you want to create a remote physical location. The storage
class must be associated with a supported storage option.
|
Image pull secret
The variables in the Image pull secret section of the script specify information about pull secret that you want to use to ensure that you have access to the required images.
Variable | Description |
---|---|
REMOTE_PULL_SECRET
|
The name to use
for the image pull secret for the remote physical
location.
|
Remote physical location
The variables in the Remote physical location section of the script specify information about the remote physical location on the remote cluster.
Variable | Description |
---|---|
REMOTE_PHYSICAL_LOCATION_ID
|
The unique ID for
the remote physical location.
|
REMOTE_PHYSICAL_LOCATION_DISPLAY_NAME |
The user-friendly
display name for the remote physical location. This name will be displayed in the web client.
|
REMOTE_PHYSICAL_LOCATION_DESCRIPTION |
The user-friendly
description of the remote physical location.
For example, specify the geographic location, purpose, or hardware available on the remote physical location. To use the
|
REMOTE_PHYSICAL_LOCATION_REGION |
The geographical
region of the remote physical location. To use the
|
REMOTE_PHYSICAL_LOCATION_MAX_CPU |
The maximum amount
of vCPU that the scheduling service can use, if the workload exceeds the current available
vCPU. Restriction: This setting
applies only if the remote cluster has a cluster autoscaler.
By default, the scheduling service uses the current available vCPU on the cluster to determine whether a workload can be scheduled on the physical location. If the remote cluster has a cluster autoscaler, use this option to specify the maximum amount of vCPU that the scheduling service can use, if the workload exceeds the current available vCPU. To use the
|
REMOTE_PHYSICAL_LOCATION_MAX_MEMORY |
The maximum amount
of memory that the scheduling service can use, if the workload exceeds the current available
memory. Restriction: This setting
applies only if the remote cluster has a cluster autoscaler.
By default, the scheduling service uses the current available memory on the cluster to determine whether a workload can be scheduled on the physical location. If the remote cluster has a cluster autoscaler, use this option to specify the maximum amount of memory that the scheduling service can use, if the workload exceeds the current available memory. To
use the
|
What to do next
Now that you've created the environment variables script for the remote physical location, you're ready to complete Updating the global image pull secret for a remote physical location.