Getting Started with Cluster Division

Why create multiple clusters?

Applications and corresponding objects often need to be separated from each other to avoid conflicts and other undesired effects. So far, all examples we have seen create one cluster. However, there are situations in which multiple clusters should be created. Some benefits of creating multiple clusters are as follows:

  • We might need to separate objects created by different teams. For example, we can give each team a separate cluster so that they can experiment without affecting others.

  • We might want to create different clusters that will be used for various purposes. For example, we have a production and a testing cluster.

  • There are many other problems that we could solve by creating different clusters. Most of them are based on the fear that some objects will produce adverse effects on others.

  • We might be afraid that a team will accidentally replace a production release of an application with an untested beta.

  • We might be concerned that performance tests will slow down the whole cluster. Fear is one of the main reasons why we tend to be defensive and conservative. In some cases, it is founded on past experiences. In others, it might be produced by insufficient knowledge of the tools we’re using. More often than not, it is a combination of the two.

The problem with multiple clusters

The problem with having many Kubernetes clusters is that each cluster has an operational and resource overhead. Managing one cluster is often far from trivial. Having a few is even more complicated. Having many can become a nightmare and requires quite a significant investment in hours dedicated to operations and maintenance.

If that overhead is not enough, we must also be aware that each cluster needs resources dedicated to Kubernetes. The more clusters we have, the more resources (CPU, memory, IO) are spent. While that can be said for big clusters, the fact remains that the resource overhead of having many smaller clusters is higher than having a single big one.

Namespaces

We are not trying to discourage you from having multiple Kubernetes clusters. In many cases, it’s a useful strategy. However, there is also the possibility of using Kubernetes namespaces instead. In this chapter, we’ll explore ways to split a cluster into different segments as an alternative to having multiple clusters.

Get hands-on with 1200+ tech skills courses.