Installation
Requirements
- kubectl
- vertical-pod-autoscaler configured in the cluster
- some workloads with pods (Goldilocks will monitor any workload controller that includes a PodSpec template (
spec.template.spec.containers[]to be specific). This includesDeployments,DaemonSets, andStatefulSetsamong others.) - metrics-server (a requirement of vpa)
- golang 1.17+
Installing Vertical Pod Autoscaler
There are multiple ways to install VPA for use with Goldilocks:
- Install using the
hack/vpa-up.shscript from the vertical-pod-autoscaler repository - Install using the Fairwinds VPA Helm Chart
Important Note about VPA
The full VPA install includes the updater and the admission webhook for VPA. Goldilocks only requires the recommender. An admission webhook can introduce unexpected results in a cluster if not planned for properly. If installing VPA using the goldilocks chart and the vpa sub-chart, only the VPA recommender will be installed. See the vpa chart and the Goldilocks values.yaml for more information.
Prometheus (optional)
VPA does not require the use of prometheus, but it is supported. The use of prometheus may provide more accurate results.
GKE Notes
VPA is enabled by default in Autopilot clusters, but you must manually enable it in Standard clusters. You can enable it like so:
gcloud container clusters update [CLUSTER-NAME] --enable-vertical-pod-autoscaling {--region [REGION-NAME] | --zone [ZONE-NAME]}NOTE: This does not support using prometheus as a data backend.
Installation
First, make sure you satisfy the requirements above.
Method 1 - Helm (preferred)
helm repo add fairwinds-stable https://charts.fairwinds.com/stable
kubectl create namespace goldilocks
Helm v2:
helm install --name goldilocks --namespace goldilocks fairwinds-stable/goldilocks
Helm v3:
helm install goldilocks --namespace goldilocks fairwinds-stable/goldilocksMethod 2 - Manifests
The hack/manifests directory contains collections of Kubernetes YAML definitions for installing the controller and dashboard components in cluster.
git clone https://github.com/FairwindsOps/goldilocks.git
cd goldilocks
kubectl create namespace goldilocks
kubectl -n goldilocks apply -f hack/manifests/controller
kubectl -n goldilocks apply -f hack/manifests/dashboardEnable Namespace
Pick an application namespace and label it like so in order to see some data:
kubectl label ns goldilocks goldilocks.fairwinds.com/enabled=trueAfter that you should start to see VPA objects in that namespace.
Viewing the Dashboard
The default installation creates a ClusterIP service for the dashboard. You can access via port forward:
kubectl -n goldilocks port-forward svc/goldilocks-dashboard 8080:80Then open your browser to http://localhost:8080