Add a worker node

Steps to add a worker node to an OpenShift 4 cluster on cloudscale.ch.

Starting situation

  • You already have an OpenShift 4 cluster on cloudscale.ch

  • You have admin-level access to the cluster

  • You want to add a worker node to the cluster

Prerequisites

The following CLI utilities need to be available locally:

  • kubectl

  • yq

Update Cluster Config

  1. Update cluster config in syn-tenant-repo on a new branch.

    CLUSTER_ID=
    
    git checkout -b add-worker-node
    
    yq eval -i ".parameters.openshift4_terraform.terraform_variables.worker_count += 1" \
      ${CLUSTER_ID}.yml
  2. Commit and create MR to review

    git commit -a -m "Add worker node to cluster ${CLUSTER_ID}"
    git push -u origin add-worker-node
  3. Compile and push the cluster catalog.

Create Node

  1. Verify output of the Terraform plan step (for example, check the output of the Terraform CI/CD pipeline in cluster catalog)

  2. If everything looks good, run terraform apply (for example, by triggering the apply step in the CI/CD pipeline).

Approve CertificateSigningRequests

# Once CSRs in state Pending show up, approve them
# Needs to be run twice, two CSRs for each node need to be approved

kubectl --as=cluster-admin get csr -w

oc --as=cluster-admin get csr -o go-template='{{range .items}}{{if not .status}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}' | \
  xargs oc --as=cluster-admin adm certificate approve

kubectl --as=cluster-admin get nodes

Label Node

  1. Check for the node name

    kubectl get node
  2. Add app role label to the node

    kubectl --as=cluster-admin label node worker-XXXX node-role.kubernetes.io/app=""
  3. [APPUiO Cloud only] Add node-class label (flex or plus)

    kubectl --as=cluster-admin label node worker-XXXX appuio.io/node-class=xxxx