Search⌘ K

Updating the Cluster

Explore how to update a production-ready Kubernetes cluster using kOps by editing the instance group configuration to increase worker nodes. Understand the declarative approach to managing cluster state, applying updates safely with commands like kops rolling-update to minimize downtime while ensuring your cluster meets new desired configurations.

Editing the definition

With kOps, we cannot update the cluster directly. Instead, we edit the desired state of the cluster stored, in our case, in the S3 bucket. Once the state is changed, kOps will make the necessary changes to comply with the new desire.

We’ll try to update the cluster so that the number of worker nodes is increased from one to two. In other words, we want to add one more server to the cluster.

The kOps edit commands

Let’s see the sub-commands provided through kops edit.

Shell
kops edit --help

We can make two types of edits:.:

Shell
...
Available Commands:
cluster Edit cluster.
instancegroup Edit instancegroup.
...

We have two types of edits we can make.

Edit cluster

You might think that cluster would provide the possibility to create a new worker node. However, that is not the case. If we execute kops edit cluster --name $NAME, we’ll see that nothing in the configuration indicates how many nodes we should have. This is normal, ...