Managing resource requests and limits in Kubernetes can be challenging, especially for teams that are new to container orchestration or scaling complex workloads. But without proper configuration, your cluster can become unstable, experience resource contention (we call that the noisy neighbor effect), or drive up cloud costs unnecessarily. This is why we created Goldilocks, an open-source tool that helps you get your resource requests and limits just right.
Recently, I joined Whitney Lee, a CNCF Ambassador who enjoys understanding and using tools in the cloud native landscape, for a really fun discussion with her on her lightboard streaming show ⚡️ Enlightning on YouTube about how Goldilocks helps teams set the resource requests and limits “just right” for their workloads. It was such a great conversation because Whitney really dug into how Goldilocks was created, what it does, how it works, and the benefits it brings to Kubernetes environments, so I thought I’d write up some of the highlights — but you should absolutely go watch the video too!
Before we introduced Goldilocks, sometimes it seemed like setting resource requests and limits in Kubernetes was a little bit like shooting in the dark. Many teams would either:
These approaches led to a range of problems, from wasted resources and increased cloud costs to unpredictable performance during peak loads. These approaches also lack any kind of predictability in terms of understanding what you need for your workloads, so you have to start from scratch every time. For companies running critical workloads, inappropriately set requests and limits could result in a significant impact on both user experience and operational costs.
"You could have a container in which the application has a memory leak or maybe one container or one pod is getting a lot more traffic than other pods. So it tries to consume an increasing amount of resources on the node. And then other pods don't have access to what they need. And then you might have your pods getting evicted or your containers being killed."
We developed Goldilocks as a response to these challenges that we saw with our Managed Kubernetes-as-a-Service clients. The tool is a visualizer for Kubernetes resource requests and limits that helps teams see what the optimal configuration should look like. Goldilocks is strictly giving you a starting point for where to set your requests and limits for CPU and memory. It provides recommendations based on real data, enabling teams to set more accurate and effective resource requests and limits.
Goldilocks is deployed as a Helm chart and runs as a controller instead of as custom resource definitions (CRDs). It works by leveraging another open-source Kubernetes tool, the Vertical Pod Autoscaler (VPA). VPA isn’t built into Kubernetes, you have to install it. VPA installs its own set of CRDs, and it essentially has three parts to it.
Goldilocks uses the information from the VPA to display a recommended starting point, so a request for your memory and your CPU and a recommended endpoint or a limit for memory and CPU. It also separates those recommendations into two different quality of service (QoS) families for Kubernetes: Burstable (which allows pods to flex their resource usage), and Guaranteed (which means a pod is less likely to be evicted under resource pressure).Goldilocks, by default, only uses the Recommender component, providing non-disruptive recommendations without altering the state of the cluster. This makes it a safe starting point for most teams who want to explore and understand their resource usage before implementing changes.
It’s simple to get started with Goldilocks. You can deploy it as a Helm chart in your Kubernetes cluster. Once installed, Goldilocks will start analyzing your workloads and provide you with recommendations for setting your resource requests and limits in a simple dashboard.
To use Goldilocks, you’ll want to:
Goldilocks is a useful open source tool for Kubernetes resource management. It simplifies the process of setting resource requests and limits, making it easier for teams to achieve the “just right” balance. With its intuitive visualizer and data-driven recommendations, Goldilocks takes the guesswork out of resource allocation, leading to more efficient, stable, and cost-effective Kubernetes workloads.
Whether you’re a small team just starting out or an enterprise managing complex cloud environments, Goldilocks is a good addition to your Kubernetes toolkit. Try it out and see how it can help you optimize your resources and improve the performance of your applications.
Check out the full Enlightening discussion with Whitney Lee for more fun and more in-depth insights into Goldilocks. You can also explore the Goldilocks GitHub repo to get started!