Kubernetes is powerful, but few folks would call it easy. On the contrary, the consensus seems to be that learning and operating Kubernetes is hard for most people, even seasoned engineers.
The good news is that there are ways to make Kubernetes management easier. By taking the right approach and taking advantage of certain tools, you can reduce the amount of complexity and effort required to get Kubernetes clusters up and running and deploy workloads on them.
Here are five best practices for making the typical Kubernetes environment easier to set up and manage.
1. Simplify Kubernetes Application Deploy with Helm
If you've ever deployed an application on Kubernetes, you know that the process can be complicated. Typically, you have to create a container image for your app (if one doesn't already exist), then write a YAML file that defines the app for Kubernetes. Then, you have to deploy it using kubectl, the Kubernetes CLI tool.
Fortunately, there is an easier way to set up software in Kubernetes: Helm. Helm is an open source package management system for Kubernetes. It lets you install, update, and remove applications in Kubernetes with just a few commands (similar to apt or dnf on Linux), and it eliminates the need to write your own deployment files by hand.
To install apps with Helm, of course, Helm packages (or charts, as Helm calls them) must exist for the apps. This makes Helm less useful if you want to deploy a custom application in Kubernetes. You would have to create the charts yourself in that case — which is not that hard, but which does require some expertise.
That said, if you want to run a popular open source application, there's a good chance that a Helm chart for it already exists and that you can install it with a few commands.
2. Keep Kubernetes Management Easy with a Managed Service
Part of the reason why Kubernetes can be so hard to use is that you have to manage a sprawling set of servers — if you choose to run Kubernetes on self-managed infrastructure, that is.
Fortunately, there's an alternative. You can use a managed Kubernetes service, like AWS EKS or Azure AKS. These services automatically provision and manage the infrastructure for you, so you don't need to worry about that work. (You may still have to add or remove nodes unless you use autoscaling — about which, see below.) You also get a managed control plane for the Kubernetes software, which makes cluster setup even easier.
3. Use Kubernetes Node Autoscaling
Another benefit of most managed Kubernetes services is that they optionally support node or cluster autoscaling. That means they can be configured to add or remove nodes from your cluster automatically, based on fluctuations in demand.
When you turn on this feature, you avoid having to add or remove nodes yourself. You also don't have to worry about overpaying for infrastructure due to running nodes that you don't need.
4. Define Multiple Namespaces
Kubernetes lets you define multiple namespaces. Namespaces are virtual, software-defined environments that separate workloads from each other. If you want to run one set of containers and manage it separately from another set, you can create a namespace for each container group.
Kubernetes doesn't require you to use more than one namespace. But they are easy to set up, and they simplify workload management because you can define different access control rules, redundancy requirements, and so on, on a per-namespace basis.
To create a new namespace, simply create a file to describe it, such as:
Then create the namespace with a command like:
kubectl create -f yournamespace.yaml
5. Avoid Multiple Clusters to Keep Kubernetes Management Easier
While having multiple namespaces generally makes Kubernetes easier to work with, running multiple clusters under the same control plane does the opposite. Networking, storage, and security become considerably more difficult when you have more than one cluster in the mix.
This isn't to say that you should never run multiple Kubernetes clusters. There are use cases where doing so makes sense, such as if you have multiple data centers that you want to manage using one Kubernetes orchestration layer, or you have a sprawling edge device network that you need to organize as a set of distinct clusters based on geographical location or device function.
But these are advanced use cases that don't apply to the typical business. Unless you have specific needs, chances are there isn't a good reason to set up multiple clusters. Use namespaces instead to segment your workloads, and keep everything within the same physical cluster.
Kubernetes can be hard to use — if you choose to do things the hard way. Fortunately, there are methods that can simplify Kubernetes setup and management. Unless you have a reason to opt for the more difficult approach, stick with simpler tools and strategies, like using Helm charts or taking advantage of managed Kubernetes services.
About the authorChristopher Tozzi is a technology analyst with subject matter expertise in cloud computing, application development, open source software, virtualization, containers and more. He also lectures at a major university in the Albany, New York, area. His book, "For Fun and Profit: A History of the Free and Open Source Software Revolution," was published by MIT Press.