From 297c5db1bd8205011342fe9a0fc6d60dd40bf878 Mon Sep 17 00:00:00 2001 From: "pin.jin@ga.gov.au" Date: Thu, 23 Dec 2021 03:54:54 +0000 Subject: [PATCH 1/2] add owner_kind Job relabeled as workload_type Job --- .../templates/prometheus/rules-1.14/k8s.rules.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.yaml b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.yaml index 3f0caae78845..511b84f5c05f 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.yaml @@ -160,4 +160,14 @@ spec: labels: workload_type: statefulset record: namespace_workload_pod:kube_pod_owner:relabel + - expr: |- + max by (cluster, namespace, workload, pod) ( + label_replace( + kube_pod_owner{job="kube-state-metrics", owner_kind="Job"}, + "workload", "$1", "owner_name", "(.*)" + ) + ) + labels: + workload_type: Job + record: namespace_workload_pod:kube_pod_owner:relabel {{- end }} \ No newline at end of file From e3e11da8618babcf0b83cb7cb027c65bcedc1e54 Mon Sep 17 00:00:00 2001 From: "pin.jin@ga.gov.au" Date: Thu, 23 Dec 2021 04:02:24 +0000 Subject: [PATCH 2/2] bump chart version Signed-off-by: pin.jin@ga.gov.au --- charts/kube-prometheus-stack/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index c845b4392dca..a82ed7e98a03 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -17,7 +17,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 25.1.0 +version: 25.1.1 appVersion: 0.53.1 kubeVersion: ">=1.16.0-0" home: https://github.com/prometheus-operator/kube-prometheus