top of page

Cut Costs and Boost Performance: Kubernetes Tuning with Goldilocks

  • May 10
  • 3 min read

Updated: May 17

Table of Contents:

Overview

As Kubernetes adoption grows, so do the challenges of managing resource efficiency. Engineers often default to overprovisioning CPU and memory requests and limits to avoid OOM errors or throttling, but this approach leads to unnecessary cloud costs and underutilized infrastructure.


What if you could intelligently tune your resource requests and limits based on actual usage? Enter Goldilocks — a powerful open-source tool developed by Fairwinds that helps you find the "just right" resource settings for your Kubernetes workloads.


In this post, we’ll dive into how Goldilocks works, why resource tuning matters, and how to integrate it into your Kubernetes environment to reduce costs and improve application performance.



Why Resource Requests and Limits Matter?

In Kubernetes, each container can specify:

  • Resource requests: The amount of CPU/Memory guaranteed to the container.

  • Resource limits: The maximum CPU/Memory the container can consume.


These values influence:

  • Scheduling: Kubernetes uses the request values to schedule pods.

  • Performance: Setting too low can cause throttling or OOMKills.

  • Costs: Setting too high leads to wasted resources.


Unfortunately, manual tuning is tedious and often inaccurate. That’s where Goldilocks comes in.


resources:
  requests:
    cpu: "500m"
    memory: "512Mi"
  limits:
    cpu: "1000m"
    memory: "1Gi"

But how do you know what’s the “right” number?



What is Goldilocks?

Goldilocks is an open-source Kubernetes controller and dashboard that recommends optimal CPU and memory requests/limits for your deployments. It integrates with the Vertical Pod Autoscaler (VPA) to analyze usage patterns and suggest fine-tuned resource settings.


Key Features:

  • Visual dashboard for recommendations

  • Namespace-level customization

  • Integrates directly with VPA

  • CLI support for automation



How Goldilocks Works?

Goldilocks deploys a controller that monitors your deployments and creates VPA objects in recommendation mode (not applying them directly). It then reads the VPA recommendations and presents them in a dashboard.


Recommendation Modes:

  • Best-effort: For minimal resource usage.

  • Burstable: Balanced cost and performance (default).

  • Guaranteed: High availability, suitable for critical apps.


These modes help teams align resource profiles with their workload priorities.



Getting Started with Goldilocks

Install Goldilocks

You can install Goldilocks using Helm:

helm repo add fairwinds-stable https://charts.fairwinds.com/stable 
helm repo update
helm install goldilocks fairwinds-stable/goldilocks --namespace goldilocks \ --create-namespace

Annotate Namespaces

Goldilocks only analyzes deployments in annotated namespaces:

kubectl label ns your-namespace goldilocks.fairwinds.com/enabled=true

Access the Dashboard

Forward the service to view the dashboard:

kubectl port-forward -n goldilocks svc/goldilocks-dashboard 8080:80

Then open http://localhost:8080 in your browser.



Example: Tuning a Deployment

Once deployed, Goldilocks will show your workloads alongside suggested requests/limits like:

Deployment

Current CPU

Suggested CPU

Current Memory

Suggested Memory

api-server

500m

250m / 200m / 400m

512Mi

300Mi / 256Mi / 500Mi

You can update your Helm charts or manifests accordingly to optimize usage.



When Not to Use Goldilocks?

Goldilocks excels in steady-state, long-running workloads. It may be less effective for:


  • Batch jobs

  • CronJobs

  • Highly variable workloads

  • Autoscaled workloads using HPA with custom metrics


Still, it can be used in tandem with other observability tools (Prometheus, Grafana, Datadog) to complement performance monitoring.



Resources:



Appointment Organizer
30
Book Now

Conclusion

Goldilocks is a game-changer for Kubernetes resource tuning. By automating recommendations, it helps teams balance cost and performance while reducing the risk of human error. If you’re looking to right-size your workloads and stop leaving money on the table, it’s time to give Goldilocks a try.


At Ananta Cloud, we specialize in building and optimizing Kubernetes platforms—integrating automation, observability, and scalability from day one.


🚀Empower your cloud-native applications with production-grade Kubernetes infrastructure and expert operational support.


📞 Contact Ananta Cloud today for a free consultation on your Kubernetes journey.




Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
average rating is 4 out of 5, based on 150 votes, Recommend it

Stay ahead with the latest insights delivered right to you.

  • Straightforward DevOps insights

  • Professional advice you can trust

  • Cutting-edge trends in IaC, automation, and DevOps

  • Proven best practices from the field

bottom of page