Skip to content

Commit 53ebeb4

Browse files
committed
fix
1 parent 5133831 commit 53ebeb4

2 files changed

Lines changed: 134 additions & 10 deletions

File tree

docs/vpa-resource-optimization.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -438,21 +438,20 @@ kubectl logs -n goldilocks -l app.kubernetes.io/name=goldilocks,app.kubernetes.i
438438
kubectl logs -n vertical-pod-autoscaler -l app.kubernetes.io/component=recommender
439439
```
440440

441-
## Grafana Dashboards
441+
## Grafana Dashboard
442442

443-
Two community dashboards are auto-provisioned in Grafana under the **Infrastructure** folder:
443+
A community VPA dashboard is auto-provisioned in Grafana under the **Infrastructure** folder:
444444

445445
| Dashboard | Grafana.com ID | What It Shows |
446446
|-----------|---------------|---------------|
447-
| **VPA Recommendations** | [14588](https://grafana.com/grafana/dashboards/14588) | Table of target/lower/upper bounds per container, namespace summary |
448-
| **K8s Autoscaling VPA** | [22168](https://grafana.com/grafana/dashboards/22168) | Cluster overview with drill-down to pod-level VPA details |
447+
| **K8s Autoscaling VPA** | [22168](https://grafana.com/grafana/dashboards/22168) | Cluster overview with drill-down to pod-level VPA details (target, lower/upper bounds) |
449448

450449
**URL**: https://grafana.vanillax.me → search for "VPA"
451450

452-
These dashboards read VPA metrics exposed by kube-state-metrics (`kube_verticalpodautoscaler_*`). Combined with Goldilocks and `vpa-report.sh`, you have three ways to view VPA data:
451+
This dashboard reads VPA metrics exposed by kube-state-metrics Custom Resource State (`kube_customresource_verticalpodautoscaler_*`). Combined with Goldilocks and `vpa-report.sh`, you have three ways to view VPA data:
453452

454453
1. **Goldilocks dashboard** — per-namespace cards with copy-paste YAML
455-
2. **Grafana VPA dashboards** — time-series graphs and historical trends
454+
2. **Grafana VPA dashboard** — time-series graphs and historical trends
456455
3. **CLI**`./scripts/vpa-report.sh` for quick terminal output
457456

458457
---

monitoring/prometheus-stack/values.yaml

Lines changed: 129 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ grafana:
209209
gnetId: 20417
210210
revision: 3
211211
datasource: Prometheus
212-
vpa-recommendations:
213-
gnetId: 14588
214-
revision: 5
215-
datasource: Prometheus
216212
vpa-autoscaling:
217213
gnetId: 22168
218214
revision: 1
@@ -278,6 +274,135 @@ kubeStateMetrics:
278274
limits:
279275
cpu: 200m
280276
memory: 256Mi
277+
# kube-state-metrics subchart values (VPA custom resource metrics)
278+
kube-state-metrics:
279+
rbac:
280+
extraRules:
281+
- apiGroups: ["autoscaling.k8s.io"]
282+
resources: ["verticalpodautoscalers"]
283+
verbs: ["list", "watch"]
284+
customResourceState:
285+
enabled: true
286+
config:
287+
kind: CustomResourceStateMetrics
288+
spec:
289+
resources:
290+
- groupVersionKind:
291+
group: autoscaling.k8s.io
292+
kind: "VerticalPodAutoscaler"
293+
version: "v1"
294+
labelsFromPath:
295+
verticalpodautoscaler: [metadata, name]
296+
namespace: [metadata, namespace]
297+
target_api_version: [spec, targetRef, apiVersion]
298+
target_kind: [spec, targetRef, kind]
299+
target_name: [spec, targetRef, name]
300+
metrics:
301+
- name: "verticalpodautoscaler_labels"
302+
help: "VPA labels"
303+
each:
304+
type: Info
305+
info:
306+
labelsFromPath:
307+
name: [metadata, name]
308+
# Memory recommendations
309+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_target"
310+
help: "VPA target memory recommendation"
311+
each:
312+
type: Gauge
313+
gauge:
314+
path: [status, recommendation, containerRecommendations]
315+
valueFrom: [target, memory]
316+
labelsFromPath:
317+
container: [containerName]
318+
commonLabels:
319+
resource: "memory"
320+
unit: "byte"
321+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound"
322+
help: "VPA lower bound memory recommendation"
323+
each:
324+
type: Gauge
325+
gauge:
326+
path: [status, recommendation, containerRecommendations]
327+
valueFrom: [lowerBound, memory]
328+
labelsFromPath:
329+
container: [containerName]
330+
commonLabels:
331+
resource: "memory"
332+
unit: "byte"
333+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound"
334+
help: "VPA upper bound memory recommendation"
335+
each:
336+
type: Gauge
337+
gauge:
338+
path: [status, recommendation, containerRecommendations]
339+
valueFrom: [upperBound, memory]
340+
labelsFromPath:
341+
container: [containerName]
342+
commonLabels:
343+
resource: "memory"
344+
unit: "byte"
345+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget"
346+
help: "VPA uncapped target memory recommendation"
347+
each:
348+
type: Gauge
349+
gauge:
350+
path: [status, recommendation, containerRecommendations]
351+
valueFrom: [uncappedTarget, memory]
352+
labelsFromPath:
353+
container: [containerName]
354+
commonLabels:
355+
resource: "memory"
356+
unit: "byte"
357+
# CPU recommendations
358+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_target"
359+
help: "VPA target CPU recommendation"
360+
each:
361+
type: Gauge
362+
gauge:
363+
path: [status, recommendation, containerRecommendations]
364+
valueFrom: [target, cpu]
365+
labelsFromPath:
366+
container: [containerName]
367+
commonLabels:
368+
resource: "cpu"
369+
unit: "core"
370+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound"
371+
help: "VPA lower bound CPU recommendation"
372+
each:
373+
type: Gauge
374+
gauge:
375+
path: [status, recommendation, containerRecommendations]
376+
valueFrom: [lowerBound, cpu]
377+
labelsFromPath:
378+
container: [containerName]
379+
commonLabels:
380+
resource: "cpu"
381+
unit: "core"
382+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound"
383+
help: "VPA upper bound CPU recommendation"
384+
each:
385+
type: Gauge
386+
gauge:
387+
path: [status, recommendation, containerRecommendations]
388+
valueFrom: [upperBound, cpu]
389+
labelsFromPath:
390+
container: [containerName]
391+
commonLabels:
392+
resource: "cpu"
393+
unit: "core"
394+
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget"
395+
help: "VPA uncapped target CPU recommendation"
396+
each:
397+
type: Gauge
398+
gauge:
399+
path: [status, recommendation, containerRecommendations]
400+
valueFrom: [uncappedTarget, cpu]
401+
labelsFromPath:
402+
container: [containerName]
403+
commonLabels:
404+
resource: "cpu"
405+
unit: "core"
281406
# Prometheus Operator Configuration
282407
prometheusOperator:
283408
enabled: true

0 commit comments

Comments
 (0)