Skip to content

Commit

Permalink
Added ephemeral_storage_container_limit_percentage metric (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgrath207 authored Dec 4, 2023
1 parent 5763094 commit 2177e8f
Show file tree
Hide file tree
Showing 12 changed files with 303 additions and 69 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: e2e

on:
push:
branches:
- 'master'
pull_request:
types: [opened, reopened]


jobs:
e2e:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ release-helm:
cd ..

release: github_login release-docker release-helm helm-docs
# ex. make VERSION=1.3.1 release
# ex. make VERSION=1.4.0 release

release-github: github_login
# ex. make VERSION=1.3.1 release-github
# ex. make VERSION=1.4.0 release-github
gh release create ${VERSION} --generate-notes
gh release upload ${VERSION} "chart/k8s-ephemeral-storage-metrics-${VERSION}.tgz"
rm chart/k8s-ephemeral-storage-metrics-*.tgz
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ helm upgrade --install my-deployment k8s-ephemeral-storage-metrics/k8s-ephemeral
| dev.enabled | bool | `false` | |
| image.imagePullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics"` | |
| image.tag | string | `"1.3.1"` | |
| image.tag | string | `"1.4.0"` | |
| interval | int | `15` | Polling node rate for exporter |
| log_level | string | `"info"` | |
| max_node_concurrency | int | `10` | Max number of concurrent query requests to the kubernetes API. |
| metrics | object | `{"adjusted_polling_rate":false,"ephemeral_storage_node_available":true,"ephemeral_storage_node_capacity":true,"ephemeral_storage_node_percentage":true,"ephemeral_storage_pod_usage":true}` | Set metrics you want to enable |
| metrics | object | `{"adjusted_polling_rate":false,"ephemeral_storage_container_limit_percentage":true,"ephemeral_storage_node_available":true,"ephemeral_storage_node_capacity":true,"ephemeral_storage_node_percentage":true,"ephemeral_storage_pod_usage":true}` | Set metrics you want to enable |
| metrics.adjusted_polling_rate | bool | `false` | Create the ephemeral_storage_adjusted_polling_rate metrics to report Adjusted Poll Rate in milliseconds. Typically used for testing. |
| metrics.ephemeral_storage_container_limit_percentage | bool | `true` | Percentage of ephemeral storage used by a container in a pod |
| metrics.ephemeral_storage_node_available | bool | `true` | Available ephemeral storage for a node |
| metrics.ephemeral_storage_node_capacity | bool | `true` | Capacity of ephemeral storage for a node |
| metrics.ephemeral_storage_node_percentage | bool | `true` | Percentage of ephemeral storage used on a node |
Expand Down
4 changes: 2 additions & 2 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: k8s-ephemeral-storage-metrics
version: 1.3.1
appVersion: 1.3.1
version: 1.4.0
appVersion: 1.4.0
kubeVersion: ">=1.21.0-0"
description: Ephemeral storage metrics for prometheus operator.
home: https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics
Expand Down
5 changes: 3 additions & 2 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ helm upgrade --install my-deployment k8s-ephemeral-storage-metrics/k8s-ephemeral
| dev.enabled | bool | `false` | |
| image.imagePullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics"` | |
| image.tag | string | `"1.3.1"` | |
| image.tag | string | `"1.4.0"` | |
| interval | int | `15` | Polling node rate for exporter |
| log_level | string | `"info"` | |
| max_node_concurrency | int | `10` | Max number of concurrent query requests to the kubernetes API. |
| metrics | object | `{"adjusted_polling_rate":false,"ephemeral_storage_node_available":true,"ephemeral_storage_node_capacity":true,"ephemeral_storage_node_percentage":true,"ephemeral_storage_pod_usage":true}` | Set metrics you want to enable |
| metrics | object | `{"adjusted_polling_rate":false,"ephemeral_storage_container_limit_percentage":true,"ephemeral_storage_node_available":true,"ephemeral_storage_node_capacity":true,"ephemeral_storage_node_percentage":true,"ephemeral_storage_pod_usage":true}` | Set metrics you want to enable |
| metrics.adjusted_polling_rate | bool | `false` | Create the ephemeral_storage_adjusted_polling_rate metrics to report Adjusted Poll Rate in milliseconds. Typically used for testing. |
| metrics.ephemeral_storage_container_limit_percentage | bool | `true` | Percentage of ephemeral storage used by a container in a pod |
| metrics.ephemeral_storage_node_available | bool | `true` | Available ephemeral storage for a node |
| metrics.ephemeral_storage_node_capacity | bool | `true` | Capacity of ephemeral storage for a node |
| metrics.ephemeral_storage_node_percentage | bool | `true` | Percentage of ephemeral storage used on a node |
Expand Down
24 changes: 23 additions & 1 deletion chart/index.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
apiVersion: v1
entries:
k8s-ephemeral-storage-metrics:
- annotations:
artifacthub.io/license: MIT
artifacthub.io/links: |
- name: Documentation
url: https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics
artifacthub.io/prerelease: "false"
apiVersion: v2
appVersion: 1.4.0
created: "2023-12-03T19:08:19.344214729-06:00"
description: Ephemeral storage metrics for prometheus operator.
digest: b671c1ba3e95f738d2d8014e4510472701911affdf6787bd0461806cea2475c0
home: https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics
keywords:
- kubernetes
- metrics
kubeVersion: '>=1.21.0-0'
name: k8s-ephemeral-storage-metrics
sources:
- https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics
urls:
- https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics/releases/download/1.4.0/k8s-ephemeral-storage-metrics-1.4.0.tgz
version: 1.4.0
- annotations:
artifacthub.io/license: MIT
artifacthub.io/links: |
Expand Down Expand Up @@ -199,4 +221,4 @@ entries:
urls:
- https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics/releases/download/1.0.0/k8s-ephemeral-storage-metrics-1.0.0.tgz
version: 1.0.0
generated: "2023-11-27T17:18:17.45365655-06:00"
generated: "2023-12-03T19:08:19.343211858-06:00"
4 changes: 4 additions & 0 deletions chart/templates/DeployType.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ spec:
- name: EPHEMERAL_STORAGE_NODE_PERCENTAGE
value: "{{ .Values.metrics.ephemeral_storage_node_percentage }}"
{{- end }}
{{- if .Values.metrics.ephemeral_storage_node_percentage }}
- name: EPHEMERAL_STORAGE_CONTAINER_LIMIT_PERCENTAGE
value: "{{ .Values.metrics.ephemeral_storage_container_limit_percentage }}"
{{- end }}
{{- if .Values.metrics.adjusted_polling_rate }}
- name: ADJUSTED_POLLING_RATE
value: "{{ .Values.metrics.adjusted_polling_rate }}"
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/RBAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
{{- include "chart.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["nodes","nodes/proxy"]
verbs: ["get","list"]
resources: ["nodes","nodes/proxy", "pods"]
verbs: ["get","list", "watch"]

---

Expand Down
10 changes: 10 additions & 0 deletions chart/templates/test_deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ spec:
- image: local.io/local/shrink-test:latest
imagePullPolicy: Never
name: shrink-test
resources:
requests:
ephemeral-storage: "1Mi"
limits:
ephemeral-storage: "5Mi"

---

Expand All @@ -40,4 +45,9 @@ spec:
- image: local.io/local/grow-test:latest
imagePullPolicy: Never
name: grow-test
resources:
requests:
ephemeral-storage: "1Mi"
limits:
ephemeral-storage: "5Mi"
{{ end }}
4 changes: 3 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
image:
repository: ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics
tag: 1.3.1
tag: 1.4.0
imagePullPolicy: IfNotPresent

# -- Set metrics you want to enable
metrics:
# -- Percentage of ephemeral storage used by a container in a pod
ephemeral_storage_container_limit_percentage: true
# -- Current ephemeral byte usage of pod
ephemeral_storage_pod_usage: true
# -- Available ephemeral storage for a node
Expand Down
Loading

0 comments on commit 2177e8f

Please sign in to comment.