5.2.7 Scaling a Kubernetes Cluster

To scale a Kubernetes cluster up or down, use the olcnectl module update command. This command updates the Kubernetes cluster so that nodes can be added to it or removed from it.

For example, if the kubernetes module named mycluster has three master nodes master1.example.com, master2.example.com, and master3.example.com and three worker nodes worker1.example.com, worker2.example.com, and worker3.example.com, and you want to add the master4.example.com master node, worker4.example.com worker node, and worker5.example.com worker node to the module:

$ olcnectl --api-server 127.0.0.1:8091 module update --environment-name myenvironment \  
  --name mycluster \
  --master-nodes master1.example.com:8090,master2.example.com:8090,master3.example.com:8090,\
master4.example.com:8090 \
  --worker-nodes worker1.example.com:8090,worker2.example.com:8090,worker3.example.com:8090,\
worker4.example.com:8090,worker5.example.com:8090

To remove the master4.example.com master node, worker4.example.com worker node, and worker5.example.com worker node from the kubernetes module named mycluster:

$ olcnectl --api-server 127.0.0.1:8091 module update --environment-name myenvironment \  
  --name mycluster \
  --master-nodes master1.example.com:8090,master2.example.com:8090,master3.example.com:8090 \
  --worker-nodes worker1.example.com:8090,worker2.example.com:8090,worker3.example.com:8090

Because three master nodes and three worker nodes are specified in both the –-master-nodes and –-worker-nodes options of the olcnectl module update command, the Platform API Server does not remove these nodes from the cluster.