Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voelzmo/draw-vpa-histograms
Simple script to draw diagrams from VPA histogram information
https://github.com/voelzmo/draw-vpa-histograms
autoscaling k8s kubernetes vertical-pod-autoscaler vpa
Last synced: 1 day ago
JSON representation
Simple script to draw diagrams from VPA histogram information
- Host: GitHub
- URL: https://github.com/voelzmo/draw-vpa-histograms
- Owner: voelzmo
- License: mit
- Created: 2022-05-27T14:56:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-03T11:49:52.000Z (8 months ago)
- Last Synced: 2024-11-08T23:12:39.209Z (about 2 months ago)
- Topics: autoscaling, k8s, kubernetes, vertical-pod-autoscaler, vpa
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What is this?
Ever wondered what the values in a VerticalPodAutoscalerCheckpoint even mean?As a human it is hard to understand this
```json
{
"apiVersion": "autoscaling.k8s.io/v1",
"kind": "VerticalPodAutoscalerCheckpoint",
"metadata": {
"creationTimestamp": "2020-07-24T02:08:41Z",
"name": "my-vpa-checkpoint",
"namespace": "default"
},
"spec": {
"containerName": "my-container",
"vpaObjectName": "my-container-vpa"
},
"status": {
"firstSampleStart": "2020-07-22T04:46:22Z",
"lastSampleStart": "2022-05-27T15:11:24Z",
"lastUpdateTime": "2022-05-27T15:11:47Z",
"memoryHistogram": {
"bucketWeights": {
"2": 38,
"35": 1,
"36": 1,
"37": 2,
"38": 55,
"39": 704,
"40": 3788,
"41": 10000,
"42": 5422,
"43": 2923,
"44": 402,
"45": 32,
"46": 5212,
"47": 1,
"48": 7
},
"referenceTimestamp": "2022-05-28T00:00:00Z",
"totalWeight": 6.673685189638553
},
"totalSamplesCount": 650223,
"version": "v3"
}
}
```
but much easier to grasp what's going on by looking at a picture!# Usage
This script expects the `bucketWeights` section of a VerticalPodAutoscalerCheckpoint object as input on `stdin`.
```
$ kubectl get verticalpodautoscalercheckpoints.autoscaling.k8s.io my-vpa-checkpoint -o jsonpath={.status.memoryHistogram.bucketWeights} | python ./plot.py --resource=memory
```And prints you a nice bar chart like this
CPU histograms now supported as well:
```
$ kubectl get verticalpodautoscalercheckpoints.autoscaling.k8s.io my-vpa-checkpoint -o jsonpath={.status.cpuHistogram.bucketWeights} | python ./plot.py --resource=cpu
```Note: the y-axis is still normalized, this means the values are not actual occurrences, but the highest bucket will always be listed as `10000`.
# Requirements
This script requires python 3 and `matplotlib` installed.