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.
-
Set default values for environment variables that might not exist in
aiops_var.shon upgraded deployments of IBM Cloud Pak for AIOps.Edit the shell script
aiops_var.shthat you created when you installed IBM Cloud Pak for AIOps on your Linux cluster. Verify that you have the following environment variables set:HTTP_PROXY,,HTTPS_PROXY,NO_PROXY.If any are not defined, then set them to an empty string, as in the following example:export HTTP_PROXY="" export HTTPS_PROXY="" export NO_PROXY=""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. -
Run the following command to source the shell script
aiops_var.shthat you created when you installed IBM Cloud Pak for AIOps on your Linux cluster.. ./aiops_var.sh -
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.
-
-
Configure a new worker node.
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 HTTP_PROXY_FLAG=$(if [ -n "${HTTP_PROXY}" ]; then echo "--http-proxy=${HTTP_PROXY} "; fi) HTTPS_PROXY_FLAG=$(if [ -n "${HTTPS_PROXY}" ]; then echo "--https-proxy=${HTTPS_PROXY} "; fi) NO_PROXY_FLAG=$(if [ -n "${NO_PROXY}" ]; then echo "--no-proxy=${NO_PROXY} "; fi) 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}" ${HTTP_PROXY_FLAG}${HTTPS_PROXY_FLAG}${NO_PROXY_FLAG}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 HTTP_PROXY_FLAG=$(if [ -n "${HTTP_PROXY}" ]; then echo "--http-proxy=${HTTP_PROXY} "; fi) HTTPS_PROXY_FLAG=$(if [ -n "${HTTPS_PROXY}" ]; then echo "--https-proxy=${HTTPS_PROXY} "; fi) NO_PROXY_FLAG=$(if [ -n "${NO_PROXY}" ]; then echo "--no-proxy=${NO_PROXY} "; fi) 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}" ${HTTP_PROXY_FLAG}${HTTPS_PROXY_FLAG}${NO_PROXY_FLAG} --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_NODESarray for the new control plane node. This is to maintain the accuracy of the environment variables file.