Resource Right-Sizing with Goldilocks
Goldilocks is a Kubernetes tool that analyzes pod resource usage and recommends CPU and memory requests/limits. It integrates with the Vertical Pod Autoscaler (VPA) to generate recommendations.
What this page covers
- Why resource requests and limits matter in K3s
- Installing Goldilocks and VPA
- Accessing the Goldilocks dashboard
- Applying resource recommendations to deployments
Why this matters
Setting CPU and memory requests/limits correctly:
- Prevents a single pod from consuming all node resources
- Enables accurate scheduling decisions by the K3s scheduler
- Provides data for capacity planning
Too-high limits waste resources. Too-low limits cause OOMKills or throttling.
Installation
# Install VPA (required by Goldilocks)
helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install vpa fairwinds-stable/vpa --namespace vpa --create-namespace
# Install Goldilocks
helm install goldilocks fairwinds-stable/goldilocks --namespace goldilocks --create-namespace
Enabling recommendations for a namespace
kubectl label namespace gitea goldilocks.fairwinds.com/enabled=true
kubectl label namespace youtrack goldilocks.fairwinds.com/enabled=true
After a few hours of operation, Goldilocks will display recommendations in its dashboard.