Adding a worker node (IBM Cloud Pak for AIOps on Linux)
Learn how to add a worker node to a Linux® cluster that has a deployment of IBM Cloud Pak® for AIOps running on it.
Procedure
-
Set environment variables.
-
Run the following command to source the shell script
aiops_var.sh
that you created when you installed IBM Cloud Pak for AIOps on your Linux cluster.. ./aiops_var.sh
For more information about
aiops_var.sh
, see Create environment variables in Online installation of IBM Cloud Pak for AIOps on Linux or Offline installation of IBM Cloud Pak for AIOps on Linux. -
Set an environment variable for the new worker node that you want to add.
export NEW_WORKER_NODE="<new_worker_node>"
Where
<new_worker_node>
is the FQDN or IP address of the worker node to be added, for exampleagent8.acme.com
.
-
-
Run the following commands to configure your new worker node.
For online deployments:
K3S_TOKEN=$(ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} aiopsctl cluster node info --token-only) K3S_HOST="https://${LOAD_BALANCER_HOST}:6443" ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} ssh ${TARGET_USER}@${NEW_WORKER_NODE} curl -LO "${AIOPSCTL_INSTALL_URL}" ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} ssh ${TARGET_USER}@${NEW_WORKER_NODE} tar xvf "${AIOPSCTL_TAR}" ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} ssh ${TARGET_USER}@${NEW_WORKER_NODE} mv aiopsctl /usr/local/bin/aiopsctl ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} ssh ${TARGET_USER}@${NEW_WORKER_NODE} aiopsctl cluster node up --accept-license=${ACCEPT_LICENSE} --role=worker --server-url="${K3S_HOST}" --token="${K3S_TOKEN}" --registry-token="${IBM_ENTITLEMENT_KEY}" --app-storage "${APP_STORAGE_PATH}"
For offline deployments:
K3S_TOKEN=$(ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} aiopsctl cluster node info --token-only) K3S_HOST="https://${LOAD_BALANCER_HOST}:6443" ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} scp -r ~/.aiopsctl ${TARGET_USER}@${NEW_WORKER_NODE}:~/.aiopsctl/ ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} scp /usr/local/bin/aiopsctl ${TARGET_USER}@${NEW_WORKER_NODE}:/usr/local/bin/aiopsctl ssh ${TARGET_USER}@${CONTROL_PLANE_NODE} ssh ${TARGET_USER}@${NEW_WORKER_NODE} aiopsctl cluster node up --accept-license=${ACCEPT_LICENSE} --role=worker --server-url="${K3S_HOST}" --token="${K3S_TOKEN}" --registry="${TARGET_REGISTRY}" --registry-user="${TARGET_REGISTRY_USER}" --registry-token="${TARGET_REGISTRY_PASSWORD}" --app-storage "${APP_STORAGE_PATH}" --offline --insecure-skip-tls-verify="${SKIP_TLS}"
-
Update the environment variables script
aiops_var.sh
.When your worker node is succesfully added and configured, add an entry for it to the
WORKER_NODES
array for the new control plane node. This is to maintain the accuracy of the environment variables file.