Skip to content

Commit

Permalink
Fix ephemeralStorageNodePercentage flag (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgrath207 authored Dec 13, 2023
1 parent f2cecb2 commit 613df20
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
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.4.1 release
# ex. make VERSION=1.4.2 release

release-github: github_login
# ex. make VERSION=1.4.1 release-github
# ex. make VERSION=1.4.2 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ helm upgrade --install my-deployment k8s-ephemeral-storage-metrics/k8s-ephemeral
| dev | object | `{"enabled":false,"image":{"imagePullPolicy":"IfNotPresent"}}` | For local development of kind and/or deploy grow and shrink test pods |
| image.imagePullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics"` | |
| image.tag | string | `"1.4.1"` | |
| image.tag | string | `"1.4.2"` | |
| 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. |
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.4.1
appVersion: 1.4.1
version: 1.4.2
appVersion: 1.4.2
kubeVersion: ">=1.21.0-0"
description: Ephemeral storage metrics for prometheus operator.
home: https://github.com/jmcgrath207/k8s-ephemeral-storage-metrics
Expand Down
2 changes: 1 addition & 1 deletion chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ helm upgrade --install my-deployment k8s-ephemeral-storage-metrics/k8s-ephemeral
| dev | object | `{"enabled":false,"image":{"imagePullPolicy":"IfNotPresent"}}` | For local development of kind and/or deploy grow and shrink test pods |
| image.imagePullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics"` | |
| image.tag | string | `"1.4.1"` | |
| image.tag | string | `"1.4.2"` | |
| 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. |
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.2
created: "2023-12-12T23:43:54.730772748-06:00"
description: Ephemeral storage metrics for prometheus operator.
digest: d2f93e587c9cbb7485294680e54f44b04e457ca57643dc5eecf96abb9a717f66
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.2/k8s-ephemeral-storage-metrics-1.4.2.tgz
version: 1.4.2
- annotations:
artifacthub.io/license: MIT
artifacthub.io/links: |
Expand Down Expand Up @@ -243,4 +265,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-12-06T22:08:48.401412493-06:00"
generated: "2023-12-12T23:43:54.729952022-06:00"
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
repository: ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics
tag: 1.4.1
tag: 1.4.2
imagePullPolicy: IfNotPresent

# -- Set metrics you want to enable
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func generateLabels(podName string, podNamespace string, nodeName string, usedBy
log.Debug().Msg(fmt.Sprintf("Node: %s capacity bytes: %f", nodeName, capacityBytes))
}

if ephemeralStorageNodeCapacity {
if ephemeralStorageNodePercentage {
percentage := (availableBytes / capacityBytes) * 100.0
labelsList = append(labelsList, CollectMetric{
value: percentage,
Expand Down

0 comments on commit 613df20

Please sign in to comment.