Action Item: Setting Kubernetes Memory Limits

Learn how Fairwinds Insights helps you set your memory limits within Kubernetes clusters.


Hi. In this video, we're going to be looking at the Insights action item, memory limits should be set. How to get more information on that action item, and how to remediate that action item in the Kubernetes cluster.

If we look at the Insights console, we see the memory limits should be set action item. We click on it and get more information, particularly where it's located in the cluster, the kind of object that this action pertains to. And this, it's a DaemonSet. One pod from this DaemonSet is going to run on every node in the cluster. We have the name of it and the specific container within the running pods that this action item pertains to. We then have more information about the action item, including why this could be an issue and how to remediate it, in particular, how to set resource limits within Kubernetes manifest.

In particular, memory limits are important not only to let Kubernetes know how much memory to limit for a workload but compared to just requests these often give Kubernetes workloads a little bit of extra room in case they're going to be busy for a short period of time or busier than normal.

Let's go into the cluster and see how this is set. If I look for the DaemonSet, I'll see it listed here. I look for the resources section I can see that memory requests are set, but not memory limits. For clarification, if you remember up here in the Insights UI it showed the container name, we can also see the container name here to make sure that we're looking at the right container within the workload. The requests are set at 500, but we don't have limits set.

While it can be challenging to set these resources without understanding how the app performs, which Insights will let you do over time, we can potentially give it, just a value to start with. Let’s put in a block for limits and say 750Mi to start. We're going to see this change, roll through the pods in the namespace. You can see a container is creating here.

Once that pod's created and running and ready to go, we'll look at it and make sure that change has been applied. Let's look one more time. We can see that's running. If we look up here, we'll see that the limits have been set to 750Mi.

We've addressed the action item Insights. The next time that report comes up, that action item should be resolved or disappear. Thanks very much.