Adding worker nodes to a cluster

Add worker nodes to a Kubernetes cluster that the installer created by raising the worker count in bootstrap.env and running the scale-workers phase.

Before you start, meet the following requirements:

  • The installer created the cluster with DEPLOY_INFRA set to true.
  • You run the installer from the working folder that created the cluster, which holds bootstrap.env and the .kubernetes-install folder.
  • INFRA_TERRAFORM_VARS_FILE is empty.
  • The installer image contains the scale-workers phase.
  1. Raise the worker count in bootstrap.env, for example, from 2 to 3.
    INFRA_WORKER_COUNT="3"
  2. Optional: Preview the commands that the phase runs.
    docker run -it --rm \
      -v "$(pwd)":/config \
      --network host \
      container.repository.cloudera.com/cloudera/ccf-install:<TAG> \
      scale-workers --dry-run

    A dry run changes neither the servers nor the cluster.

  3. Run the scale-workers phase.
    docker run -it --rm \
      -v "$(pwd)":/config \
      --network host \
      container.repository.cloudera.com/cloudera/ccf-install:<TAG> \
      scale-workers

    The phase creates the new servers with Terraform, bootstraps only the new hosts, joins them to the cluster, and waits until the nodes are Ready. A run takes about 5 minutes on Cloudera Cloud Core.

  4. Verify that the new nodes are in the cluster and that nodes.json records them.
    kubectl --kubeconfig .kubernetes-install/kubeconfig get nodes
    cat .kubernetes-install/nodes.json

The cluster has the number of workers that INFRA_WORKER_COUNT specifies, and every new worker is Ready. The phase numbers the new workers after the highest existing worker, for example, worker-3 and then worker-4, and it does not reuse the numbers of removed workers.

If a new server is created but does not join the cluster, the phase keeps the server as pending_join in nodes.json. Fix the cause, and run the phase again to finish the join without creating another server. For more information, see A new worker node does not join the cluster.