From 1c1f688d57805389d051777bef8f55176494e09e Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 12 Sep 2023 13:07:47 +0300 Subject: [PATCH 01/15] [prometheus-pushgateway] bump pushgateway to 1.6.1 (#3785) * bump pushgateway to 1.6.1 Signed-off-by: drfaust92 * Update charts/prometheus-pushgateway/Chart.yaml Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Ilia Lazebnik --------- Signed-off-by: drfaust92 Signed-off-by: Ilia Lazebnik Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus-pushgateway/Chart.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/charts/prometheus-pushgateway/Chart.yaml b/charts/prometheus-pushgateway/Chart.yaml index 5a49ca875b4f..80f9a5530742 100644 --- a/charts/prometheus-pushgateway/Chart.yaml +++ b/charts/prometheus-pushgateway/Chart.yaml @@ -1,22 +1,22 @@ apiVersion: v2 -appVersion: "v1.6.0" +appVersion: "v1.6.1" description: A Helm chart for prometheus pushgateway name: prometheus-pushgateway -version: 2.4.0 +version: 2.4.1 home: https://github.com/prometheus/pushgateway sources: -- https://github.com/prometheus/pushgateway + - https://github.com/prometheus/pushgateway type: application keywords: -- pushgateway -- prometheus + - pushgateway + - prometheus maintainers: -- email: gianrubio@gmail.com - name: gianrubio -- email: christian.staude@staffbase.com - name: cstaud -- email: rootsandtrees@posteo.de - name: zeritti + - email: gianrubio@gmail.com + name: gianrubio + - email: christian.staude@staffbase.com + name: cstaud + - email: rootsandtrees@posteo.de + name: zeritti annotations: "artifacthub.io/license": Apache-2.0 "artifacthub.io/links": | From c0c87f088d06130bc97cc58a234f2ae8ac14d31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20=C3=81guas?= Date: Tue, 12 Sep 2023 13:21:20 +0200 Subject: [PATCH 02/15] [kube-prometheus-stack] fix reloader-web's app protocol (#3762) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [kube-prometheus-stack] fix reloader-web's app protocol Signed-off-by: Andre Baptista Aguas * guard appProtocol with target kubernetes version check Signed-off-by: Andre Baptista Aguas * Move kubeTargetVersion to top of file Signed-off-by: André Águas * Move kubeTargetVersion to top of file Signed-off-by: André Águas --------- Signed-off-by: Andre Baptista Aguas Signed-off-by: André Águas --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../kube-prometheus-stack/templates/alertmanager/service.yaml | 4 ++++ .../kube-prometheus-stack/templates/prometheus/service.yaml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index d0810a6aa6e1..fc28745fdaac 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.0.1 +version: 51.0.2 appVersion: v0.68.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/alertmanager/service.yaml b/charts/kube-prometheus-stack/templates/alertmanager/service.yaml index 1905c6e9c978..f772ec628990 100644 --- a/charts/kube-prometheus-stack/templates/alertmanager/service.yaml +++ b/charts/kube-prometheus-stack/templates/alertmanager/service.yaml @@ -1,3 +1,4 @@ +{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} {{- if .Values.alertmanager.enabled }} apiVersion: v1 kind: Service @@ -44,6 +45,9 @@ spec: targetPort: {{ .Values.alertmanager.service.targetPort }} protocol: TCP - name: reloader-web + {{- if semverCompare ">=1.20.0-0" $kubeTargetVersion }} + appProtocol: http + {{- end }} port: 8080 targetPort: reloader-web {{- if .Values.alertmanager.service.additionalPorts }} diff --git a/charts/kube-prometheus-stack/templates/prometheus/service.yaml b/charts/kube-prometheus-stack/templates/prometheus/service.yaml index ec9110d6304c..7834dedd2f50 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/service.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/service.yaml @@ -1,3 +1,4 @@ +{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} {{- if .Values.prometheus.enabled }} apiVersion: v1 kind: Service @@ -43,6 +44,9 @@ spec: port: {{ .Values.prometheus.service.port }} targetPort: {{ .Values.prometheus.service.targetPort }} - name: reloader-web + {{- if semverCompare "> 1.20.0-0" $kubeTargetVersion }} + appProtocol: http + {{- end }} port: 8080 targetPort: reloader-web {{- if .Values.prometheus.thanosIngress.enabled }} From 4ddc439b8c82945777923d987c42f132ea574c7b Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 12 Sep 2023 17:15:15 +0300 Subject: [PATCH 03/15] bump redis exporter to 1.54.0 (#3784) Signed-off-by: drfaust92 --- charts/prometheus-redis-exporter/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/prometheus-redis-exporter/Chart.yaml b/charts/prometheus-redis-exporter/Chart.yaml index 98fc0f4cf08f..3119e1071740 100644 --- a/charts/prometheus-redis-exporter/Chart.yaml +++ b/charts/prometheus-redis-exporter/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: v1.44.0 +appVersion: v1.54.0 description: Prometheus exporter for Redis metrics name: prometheus-redis-exporter -version: 5.5.0 +version: 5.6.0 home: https://github.com/oliver006/redis_exporter sources: - https://github.com/oliver006/redis_exporter From 595b67800a3d1cb3894dee52fa106b1ad892ca52 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 12 Sep 2023 18:39:22 +0300 Subject: [PATCH 04/15] bump adapter to 0.11.1 (#3782) Signed-off-by: drfaust92 Co-authored-by: MH --- charts/prometheus-adapter/Chart.yaml | 4 ++-- charts/prometheus-adapter/templates/deployment.yaml | 2 +- charts/prometheus-adapter/values.yaml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/prometheus-adapter/Chart.yaml b/charts/prometheus-adapter/Chart.yaml index 84a22eb9872f..5759511c5bb3 100644 --- a/charts/prometheus-adapter/Chart.yaml +++ b/charts/prometheus-adapter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: prometheus-adapter -version: 4.4.1 -appVersion: v0.11.0 +version: 4.5.0 +appVersion: v0.11.1 description: A Helm chart for k8s prometheus adapter home: https://github.com/kubernetes-sigs/prometheus-adapter keywords: diff --git a/charts/prometheus-adapter/templates/deployment.yaml b/charts/prometheus-adapter/templates/deployment.yaml index 5be132f9beb9..8068180b443d 100644 --- a/charts/prometheus-adapter/templates/deployment.yaml +++ b/charts/prometheus-adapter/templates/deployment.yaml @@ -50,7 +50,7 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- with .Values.env }} env: diff --git a/charts/prometheus-adapter/values.yaml b/charts/prometheus-adapter/values.yaml index a1dc139a1a26..495a5c764f3c 100644 --- a/charts/prometheus-adapter/values.yaml +++ b/charts/prometheus-adapter/values.yaml @@ -4,7 +4,8 @@ topologySpreadConstraints: [] image: repository: registry.k8s.io/prometheus-adapter/prometheus-adapter - tag: v0.11.0 + # if not set appVersion field from Chart.yaml is used + tag: "" pullPolicy: IfNotPresent logLevel: 4 From b7ba011dedf81d4fbd78cbf87d9905f1cfb51081 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 12 Sep 2023 18:42:15 +0300 Subject: [PATCH 05/15] bump mongo exporter to 0.39.0 (#3783) Signed-off-by: drfaust92 Co-authored-by: MH --- charts/prometheus-mongodb-exporter/Chart.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/charts/prometheus-mongodb-exporter/Chart.yaml b/charts/prometheus-mongodb-exporter/Chart.yaml index d2a823972768..7175b61e5067 100644 --- a/charts/prometheus-mongodb-exporter/Chart.yaml +++ b/charts/prometheus-mongodb-exporter/Chart.yaml @@ -1,18 +1,18 @@ apiVersion: v2 -appVersion: "0.31.0" +appVersion: "0.39.0" description: A Prometheus exporter for MongoDB metrics home: https://github.com/percona/mongodb_exporter keywords: -- exporter -- metrics -- mongodb -- prometheus + - exporter + - metrics + - mongodb + - prometheus maintainers: -- email: ssheehy@firescope.com - name: steven-sheehy -- email: rootsandtrees@posteo.de - name: zeritti + - email: ssheehy@firescope.com + name: steven-sheehy + - email: rootsandtrees@posteo.de + name: zeritti name: prometheus-mongodb-exporter sources: -- https://github.com/percona/mongodb_exporter -version: 3.3.1 + - https://github.com/percona/mongodb_exporter +version: 3.4.0 From 0f018d18ca0eb562621a2bd3d0f90a1a49bb2ced Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 12 Sep 2023 23:32:14 +0300 Subject: [PATCH 06/15] [prometheus-elasticsearch-exporter] bump elastic-exporter to 1.6.0 (#3781) * bump elasticexporter to 1.6.0 Signed-off-by: drfaust92 * revert lint changes Signed-off-by: drfaust92 --------- Signed-off-by: drfaust92 --- charts/prometheus-elasticsearch-exporter/Chart.yaml | 4 ++-- .../templates/deployment.yaml | 4 ++-- charts/prometheus-elasticsearch-exporter/values.yaml | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/charts/prometheus-elasticsearch-exporter/Chart.yaml b/charts/prometheus-elasticsearch-exporter/Chart.yaml index e5a29cd2aa10..10cc69ac72eb 100644 --- a/charts/prometheus-elasticsearch-exporter/Chart.yaml +++ b/charts/prometheus-elasticsearch-exporter/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v1 description: Elasticsearch stats exporter for Prometheus name: prometheus-elasticsearch-exporter -version: 5.2.0 +version: 5.3.0 kubeVersion: ">=1.10.0-0" -appVersion: 1.5.0 +appVersion: "v1.6.0" home: https://github.com/prometheus-community/elasticsearch_exporter sources: - https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-elasticsearch-exporter diff --git a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml index acb6131fbd87..05e6573631ff 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml @@ -75,7 +75,7 @@ spec: - secretRef: name: {{ .Values.envFromSecret }} {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: ["elasticsearch_exporter", {{- with .Values.log.format }} @@ -109,7 +109,7 @@ spec: "--es.snapshots", {{- end }} {{- if .Values.es.cluster_settings }} - "--es.cluster_settings", + "--collector.clustersettings", {{- end }} {{- if .Values.es.slm }} "--es.slm", diff --git a/charts/prometheus-elasticsearch-exporter/values.yaml b/charts/prometheus-elasticsearch-exporter/values.yaml index 720070e3f11c..ce15680ce103 100644 --- a/charts/prometheus-elasticsearch-exporter/values.yaml +++ b/charts/prometheus-elasticsearch-exporter/values.yaml @@ -14,7 +14,8 @@ restartPolicy: Always image: repository: quay.io/prometheuscommunity/elasticsearch-exporter - tag: v1.5.0 + # if not set appVersion field from Chart.yaml is used + tag: "" pullPolicy: IfNotPresent pullSecret: "" From 183caeeea23b215ddfa4443a1599a45fc43ed006 Mon Sep 17 00:00:00 2001 From: Morten Birkelund Date: Wed, 13 Sep 2023 12:35:00 +0200 Subject: [PATCH 07/15] [prometheus] Adding additionalPorts and servicePort (#3779) * Adding additionalPorts and servicePort Signed-off-by: Morten Birkelund * Change version bump from patch to minor Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Morten Birkelund --------- Signed-off-by: Morten Birkelund Signed-off-by: MH Signed-off-by: Morten Birkelund Co-authored-by: MH Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/templates/ingress.yaml | 2 +- charts/prometheus/templates/service.yaml | 3 +++ charts/prometheus/values.yaml | 23 +++++++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index d65d78c7f6ae..53571bbfab10 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: v2.47.0 -version: 24.4.0 +version: 24.5.0 kubeVersion: ">=1.19.0-0" description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/charts/prometheus/templates/ingress.yaml b/charts/prometheus/templates/ingress.yaml index fc2468d8bc5b..84341a9c2cf0 100644 --- a/charts/prometheus/templates/ingress.yaml +++ b/charts/prometheus/templates/ingress.yaml @@ -4,7 +4,7 @@ {{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}} {{- $releaseName := .Release.Name -}} {{- $serviceName := include "prometheus.server.fullname" . }} -{{- $servicePort := .Values.server.service.servicePort -}} +{{- $servicePort := .Values.server.ingress.servicePort | default .Values.server.service.servicePort -}} {{- $ingressPath := .Values.server.ingress.path -}} {{- $ingressPathType := .Values.server.ingress.pathType -}} {{- $extraPaths := .Values.server.ingress.extraPaths -}} diff --git a/charts/prometheus/templates/service.yaml b/charts/prometheus/templates/service.yaml index 1aa384eb0a97..069f3270d813 100644 --- a/charts/prometheus/templates/service.yaml +++ b/charts/prometheus/templates/service.yaml @@ -47,6 +47,9 @@ spec: nodePort: {{ .Values.server.service.gRPC.nodePort }} {{- end }} {{- end }} +{{- if .Values.server.service.additionalPorts }} +{{ toYaml .Values.server.service.additionalPorts | indent 4 }} +{{- end }} selector: {{- if and .Values.server.statefulSet.enabled .Values.server.service.statefulsetReplica.enabled }} statefulset.kubernetes.io/pod-name: {{ template "prometheus.server.fullname" . }}-{{ .Values.server.service.statefulsetReplica.replica }} diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index 45d3bcd32b9c..b47ec9921c36 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -117,6 +117,19 @@ server: # sidecarContainers: # webserver: # image: nginx + # OR for adding OAuth authentication to Prometheus + # sidecarContainers: + # oauth-proxy: + # image: quay.io/oauth2-proxy/oauth2-proxy:v7.1.2 + # args: + # - --upstream=http://127.0.0.1:9090 + # - --http-address=0.0.0.0:8081 + # - ... + # ports: + # - containerPort: 8081 + # name: oauth-proxy + # protocol: TCP + # resources: {} sidecarContainers: {} # sidecarTemplateValues - context to be used in template for sidecarContainers @@ -309,6 +322,9 @@ server: ## extraLabels: {} + ## Redirect ingress to an additional defined port on the service + # servicePort: 8081 + ## Prometheus server Ingress hostnames with optional path ## Must be provided if Ingress is enabled ## @@ -647,6 +663,13 @@ server: enabled: false replica: 0 + ## Additional port to define in the Service + additionalPorts: [] + # additionalPorts: + # - name: authenticated + # port: 8081 + # targetPort: 8081 + ## Prometheus server pod termination grace period ## terminationGracePeriodSeconds: 300 From d1c27b968686fc2d598fff6ce5565f82205253d8 Mon Sep 17 00:00:00 2001 From: Sho Ce <261885+shoce@users.noreply.github.com> Date: Thu, 14 Sep 2023 12:29:07 +0530 Subject: [PATCH 08/15] [prometheus-node-exporter] Remove toYaml function in extraManifests template (#3799) Analogous to https://github.com/prometheus-community/helm-charts/pull/3287/ made for prometheus chart Signed-off-by: Sho Ce <261885+shoce@users.noreply.github.com> --- charts/prometheus-node-exporter/Chart.yaml | 2 +- charts/prometheus-node-exporter/templates/extra-manifests.yaml | 2 +- charts/prometheus-node-exporter/values.yaml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/prometheus-node-exporter/Chart.yaml b/charts/prometheus-node-exporter/Chart.yaml index 6aca4accebe1..76b9a7ecc0e5 100644 --- a/charts/prometheus-node-exporter/Chart.yaml +++ b/charts/prometheus-node-exporter/Chart.yaml @@ -6,7 +6,7 @@ keywords: - prometheus - exporter type: application -version: 4.23.0 +version: 4.23.1 appVersion: 1.6.1 home: https://github.com/prometheus/node_exporter/ sources: diff --git a/charts/prometheus-node-exporter/templates/extra-manifests.yaml b/charts/prometheus-node-exporter/templates/extra-manifests.yaml index 567f7bf32971..2b21b710621f 100644 --- a/charts/prometheus-node-exporter/templates/extra-manifests.yaml +++ b/charts/prometheus-node-exporter/templates/extra-manifests.yaml @@ -1,4 +1,4 @@ {{ range .Values.extraManifests }} --- -{{ tpl (toYaml .) $ }} +{{ tpl . $ }} {{ end }} diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index 8cfd16293d25..511a5906aa3d 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -471,7 +471,8 @@ verticalPodAutoscaler: # Extra manifests to deploy as an array extraManifests: [] - # - apiVersion: v1 + # - | + # apiVersion: v1 # kind: ConfigMap # metadata: # name: prometheus-extra From 723cfad365d5c55b84162d4a5f11294ea736ca54 Mon Sep 17 00:00:00 2001 From: Piotr Kowalczyk Date: Thu, 14 Sep 2023 13:29:55 +0200 Subject: [PATCH 09/15] [kube-prometheus-stack] Adding operating systems values for node exporter (#3778) * Adding operaring systems values for node exporter to support linux and darwin Signed-off-by: Piotr Kowalczyk * Bumping minor version of kube-prometheus-stack helm chart Signed-off-by: Piotr Kowalczyk --------- Signed-off-by: Piotr Kowalczyk --- charts/kube-prometheus-stack/Chart.yaml | 2 +- charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py | 4 ++-- .../templates/grafana/dashboards-1.14/nodes-darwin.yaml | 4 ++-- .../templates/grafana/dashboards-1.14/nodes.yaml | 4 ++-- charts/kube-prometheus-stack/values.yaml | 5 +++++ 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index fc28745fdaac..b57ddcdddfdf 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.0.2 +version: 51.0.3 appVersion: v0.68.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py b/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py index c955d8155c1e..d191b1ca0a29 100755 --- a/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py +++ b/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py @@ -54,8 +54,8 @@ def new_representer(dumper, data): 'scheduler': ' .Values.kubeScheduler.enabled', 'node-rsrc-use': ' .Values.nodeExporter.enabled', 'node-cluster-rsrc-use': ' .Values.nodeExporter.enabled', - 'nodes': ' .Values.nodeExporter.enabled', - 'nodes-darwin': ' .Values.nodeExporter.enabled', + 'nodes': ' .Values.nodeExporter.operatingSystems.linux.enabled', + 'nodes-darwin': ' .Values.nodeExporter.operatingSystems.darwin.enabled', 'prometheus-remote-write': ' .Values.prometheus.prometheusSpec.remoteWriteDashboards' } diff --git a/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes-darwin.yaml b/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes-darwin.yaml index 8b9ad7f5b1fa..b43442206d48 100644 --- a/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes-darwin.yaml +++ b/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes-darwin.yaml @@ -4,7 +4,7 @@ Do not change in-place! In order to change this file first read following link: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack */ -}} {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} -{{- if and (or .Values.grafana.enabled .Values.grafana.forceDeployDashboards) (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.grafana.defaultDashboardsEnabled .Values.nodeExporter.enabled }} +{{- if and (or .Values.grafana.enabled .Values.grafana.forceDeployDashboards) (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.grafana.defaultDashboardsEnabled .Values.nodeExporter.enabled .Values.nodeExporter.operatingSystems.darwin.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -21,4 +21,4 @@ metadata: data: nodes-darwin.json: |- {{`{"__inputs":[],"__requires":[],"annotations":{"list":[]},"editable":false,"gnetId":null,"graphTooltip":1,"hideControls":false,"id":null,"links":[],"refresh":"30s","rows":[{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":1,"fillGradient":0,"gridPos":{},"id":2,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":true,"steppedLine":false,"targets":[{"expr":"(\n (1 - sum without (mode) (rate(node_cpu_seconds_total{job=\"node-exporter\", mode=~\"idle|iowait|steal\", instance=\"$instance\"}[$__rate_interval])))\n/ ignoring(cpu) group_left\n count without (cpu, mode) (node_cpu_seconds_total{job=\"node-exporter\", mode=\"idle\", instance=\"$instance\"})\n)\n","format":"time_series","intervalFactor":5,"legendFormat":"{{cpu}}","refId":"A"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"CPU Usage","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"percentunit","label":null,"logBase":1,"max":1,"min":0,"show":true},{"format":"percentunit","label":null,"logBase":1,"max":1,"min":0,"show":true}]},{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":0,"fillGradient":0,"gridPos":{},"id":3,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"node_load1{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"1m load average","refId":"A"},{"expr":"node_load5{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"5m load average","refId":"B"},{"expr":"node_load15{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"15m load average","refId":"C"},{"expr":"count(node_cpu_seconds_total{job=\"node-exporter\", instance=\"$instance\", mode=\"idle\"})","format":"time_series","intervalFactor":2,"legendFormat":"logical cores","refId":"D"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Load Average","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true}]}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"CPU","titleSize":"h6","type":"row"},{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":1,"fillGradient":0,"gridPos":{},"id":4,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":9,"stack":false,"steppedLine":false,"targets":[{"expr":"node_memory_total_bytes{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"Physical Memory","refId":"A"},{"expr":"(\n node_memory_internal_bytes{job=\"node-exporter\", instance=\"$instance\"} -\n node_memory_purgeable_bytes{job=\"node-exporter\", instance=\"$instance\"} +\n node_memory_wired_bytes{job=\"node-exporter\", instance=\"$instance\"} +\n node_memory_compressed_bytes{job=\"node-exporter\", instance=\"$instance\"}\n)\n","format":"time_series","intervalFactor":2,"legendFormat":"Memory Used","refId":"B"},{"expr":"(\n node_memory_internal_bytes{job=\"node-exporter\", instance=\"$instance\"} -\n node_memory_purgeable_bytes{job=\"node-exporter\", instance=\"$instance\"}\n)\n","format":"time_series","intervalFactor":2,"legendFormat":"App Memory","refId":"C"},{"expr":"node_memory_wired_bytes{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"Wired Memory","refId":"D"},{"expr":"node_memory_compressed_bytes{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"Compressed","refId":"E"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Memory Usage","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bytes","label":null,"logBase":1,"max":null,"min":0,"show":true}]},{"datasource":"$datasource","fieldConfig":{"defaults":{"max":100,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"rgba(50, 172, 45, 0.97)"},{"color":"rgba(237, 129, 40, 0.89)","value":80},{"color":"rgba(245, 54, 54, 0.9)","value":90}]},"unit":"percent"}},"gridPos":{},"id":5,"span":3,"targets":[{"expr":"(\n (\n avg(node_memory_internal_bytes{job=\"node-exporter\", instance=\"$instance\"}) -\n avg(node_memory_purgeable_bytes{job=\"node-exporter\", instance=\"$instance\"}) +\n avg(node_memory_wired_bytes{job=\"node-exporter\", instance=\"$instance\"}) +\n avg(node_memory_compressed_bytes{job=\"node-exporter\", instance=\"$instance\"})\n ) /\n avg(node_memory_total_bytes{job=\"node-exporter\", instance=\"$instance\"})\n)\n*\n100\n","format":"time_series","intervalFactor":2,"legendFormat":""}],"title":"Memory Usage","transparent":false,"type":"gauge"}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"Memory","titleSize":"h6","type":"row"},{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":0,"fillGradient":0,"gridPos":{},"id":6,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[{"alias":"/ read| written/","yaxis":1},{"alias":"/ io time/","yaxis":2}],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(node_disk_read_bytes_total{job=\"node-exporter\", instance=\"$instance\", device=~\"(/dev/)?(mmcblk.p.+|nvme.+|rbd.+|sd.+|vd.+|xvd.+|dm-.+|md.+|dasd.+)\"}[$__rate_interval])","format":"time_series","intervalFactor":1,"legendFormat":"{{device}} read","refId":"A"},{"expr":"rate(node_disk_written_bytes_total{job=\"node-exporter\", instance=\"$instance\", device=~\"(/dev/)?(mmcblk.p.+|nvme.+|rbd.+|sd.+|vd.+|xvd.+|dm-.+|md.+|dasd.+)\"}[$__rate_interval])","format":"time_series","intervalFactor":1,"legendFormat":"{{device}} written","refId":"B"},{"expr":"rate(node_disk_io_time_seconds_total{job=\"node-exporter\", instance=\"$instance\", device=~\"(/dev/)?(mmcblk.p.+|nvme.+|rbd.+|sd.+|vd.+|xvd.+|dm-.+|md.+|dasd.+)\"}[$__rate_interval])","format":"time_series","intervalFactor":1,"legendFormat":"{{device}} io time","refId":"C"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Disk I/O","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"percentunit","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"datasource":"$datasource","fieldConfig":{"defaults":{"custom":{},"thresholds":{"mode":"absolute","steps":[{"color":"green"},{"color":"yellow","value":0.8},{"color":"red","value":0.9}]},"unit":"decbytes"},"overrides":[{"matcher":{"id":"byName","options":"Mounted on"},"properties":[{"id":"custom.width","value":260}]},{"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"custom.width","value":93}]},{"matcher":{"id":"byName","options":"Used"},"properties":[{"id":"custom.width","value":72}]},{"matcher":{"id":"byName","options":"Available"},"properties":[{"id":"custom.width","value":88}]},{"matcher":{"id":"byName","options":"Used, %"},"properties":[{"id":"unit","value":"percentunit"},{"id":"custom.displayMode","value":"gradient-gauge"},{"id":"max","value":1},{"id":"min","value":0}]}]},"gridPos":{},"id":7,"span":6,"targets":[{"expr":"max by (mountpoint) (node_filesystem_size_bytes{job=\"node-exporter\", instance=\"$instance\", fstype!=\"\", mountpoint!=\"\"})\n","format":"table","instant":true,"intervalFactor":2,"legendFormat":""},{"expr":"max by (mountpoint) (node_filesystem_avail_bytes{job=\"node-exporter\", instance=\"$instance\", fstype!=\"\", mountpoint!=\"\"})\n","format":"table","instant":true,"intervalFactor":2,"legendFormat":""}],"title":"Disk Space Usage","transformations":[{"id":"groupBy","options":{"fields":{"Value #A":{"aggregations":["lastNotNull"],"operation":"aggregate"},"Value #B":{"aggregations":["lastNotNull"],"operation":"aggregate"},"mountpoint":{"aggregations":[],"operation":"groupby"}}}},{"id":"merge","options":{}},{"id":"calculateField","options":{"alias":"Used","binary":{"left":"Value #A (lastNotNull)","operator":"-","reducer":"sum","right":"Value #B (lastNotNull)"},"mode":"binary","reduce":{"reducer":"sum"}}},{"id":"calculateField","options":{"alias":"Used, %","binary":{"left":"Used","operator":"/","reducer":"sum","right":"Value #A (lastNotNull)"},"mode":"binary","reduce":{"reducer":"sum"}}},{"id":"organize","options":{"excludeByName":{},"indexByName":{},"renameByName":{"Value #A (lastNotNull)":"Size","Value #B (lastNotNull)":"Available","mountpoint":"Mounted on"}}},{"id":"sortBy","options":{"fields":{},"sort":[{"field":"Mounted on"}]}}],"transparent":false,"type":"table"}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"Disk","titleSize":"h6","type":"row"},{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","description":"Network received (bits/s)","fill":0,"fillGradient":0,"gridPos":{},"id":8,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(node_network_receive_bytes_total{job=\"node-exporter\", instance=\"$instance\", device!=\"lo\"}[$__rate_interval]) * 8","format":"time_series","intervalFactor":1,"legendFormat":"{{device}}","refId":"A"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Network Received","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true}]},{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","description":"Network transmitted (bits/s)","fill":0,"fillGradient":0,"gridPos":{},"id":9,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(node_network_transmit_bytes_total{job=\"node-exporter\", instance=\"$instance\", device!=\"lo\"}[$__rate_interval]) * 8","format":"time_series","intervalFactor":1,"legendFormat":"{{device}}","refId":"A"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Network Transmitted","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true}]}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"Network","titleSize":"h6","type":"row"}],"schemaVersion":14,"style":"dark","tags":["node-exporter-mixin"],"templating":{"list":[{"current":{"text":"default","value":"default"},"hide":0,"label":"Data Source","name":"datasource","options":[],"query":"prometheus","refresh":1,"regex":"","type":"datasource"},{"allValue":null,"current":{},"datasource":"$datasource","hide":0,"includeAll":false,"label":"Instance","multi":false,"name":"instance","options":[],"query":"label_values(node_uname_info{job=\"node-exporter\", sysname=\"Darwin\"}, instance)","refresh":2,"regex":"","sort":0,"tagValuesQuery":"","tags":[],"tagsQuery":"","type":"query","useTags":false}]},"time":{"from":"now-1h","to":"now"},"timepicker":{"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"Node Exporter / MacOS","version":0}`}} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes.yaml b/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes.yaml index fe97d0296b6c..f79de1f41cff 100644 --- a/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes.yaml +++ b/charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/nodes.yaml @@ -4,7 +4,7 @@ Do not change in-place! In order to change this file first read following link: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack */ -}} {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} -{{- if and (or .Values.grafana.enabled .Values.grafana.forceDeployDashboards) (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.grafana.defaultDashboardsEnabled .Values.nodeExporter.enabled }} +{{- if and (or .Values.grafana.enabled .Values.grafana.forceDeployDashboards) (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.grafana.defaultDashboardsEnabled .Values.nodeExporter.enabled .Values.nodeExporter.operatingSystems.linux.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -21,4 +21,4 @@ metadata: data: nodes.json: |- {{`{"__inputs":[],"__requires":[],"annotations":{"list":[]},"editable":false,"gnetId":null,"graphTooltip":1,"hideControls":false,"id":null,"links":[],"refresh":"30s","rows":[{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":1,"fillGradient":0,"gridPos":{},"id":2,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":true,"steppedLine":false,"targets":[{"expr":"(\n (1 - sum without (mode) (rate(node_cpu_seconds_total{job=\"node-exporter\", mode=~\"idle|iowait|steal\", instance=\"$instance\"}[$__rate_interval])))\n/ ignoring(cpu) group_left\n count without (cpu, mode) (node_cpu_seconds_total{job=\"node-exporter\", mode=\"idle\", instance=\"$instance\"})\n)\n","format":"time_series","intervalFactor":5,"legendFormat":"{{cpu}}","refId":"A"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"CPU Usage","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"percentunit","label":null,"logBase":1,"max":1,"min":0,"show":true},{"format":"percentunit","label":null,"logBase":1,"max":1,"min":0,"show":true}]},{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":0,"fillGradient":0,"gridPos":{},"id":3,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"node_load1{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"1m load average","refId":"A"},{"expr":"node_load5{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"5m load average","refId":"B"},{"expr":"node_load15{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"15m load average","refId":"C"},{"expr":"count(node_cpu_seconds_total{job=\"node-exporter\", instance=\"$instance\", mode=\"idle\"})","format":"time_series","intervalFactor":2,"legendFormat":"logical cores","refId":"D"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Load Average","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true}]}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"CPU","titleSize":"h6","type":"row"},{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":1,"fillGradient":0,"gridPos":{},"id":4,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":9,"stack":true,"steppedLine":false,"targets":[{"expr":"(\n node_memory_MemTotal_bytes{job=\"node-exporter\", instance=\"$instance\"}\n-\n node_memory_MemFree_bytes{job=\"node-exporter\", instance=\"$instance\"}\n-\n node_memory_Buffers_bytes{job=\"node-exporter\", instance=\"$instance\"}\n-\n node_memory_Cached_bytes{job=\"node-exporter\", instance=\"$instance\"}\n)\n","format":"time_series","intervalFactor":2,"legendFormat":"memory used","refId":"A"},{"expr":"node_memory_Buffers_bytes{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"memory buffers","refId":"B"},{"expr":"node_memory_Cached_bytes{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"memory cached","refId":"C"},{"expr":"node_memory_MemFree_bytes{job=\"node-exporter\", instance=\"$instance\"}","format":"time_series","intervalFactor":2,"legendFormat":"memory free","refId":"D"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Memory Usage","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bytes","label":null,"logBase":1,"max":null,"min":0,"show":true}]},{"datasource":"$datasource","fieldConfig":{"defaults":{"max":100,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"rgba(50, 172, 45, 0.97)"},{"color":"rgba(237, 129, 40, 0.89)","value":80},{"color":"rgba(245, 54, 54, 0.9)","value":90}]},"unit":"percent"}},"gridPos":{},"id":5,"span":3,"targets":[{"expr":"100 -\n(\n avg(node_memory_MemAvailable_bytes{job=\"node-exporter\", instance=\"$instance\"}) /\n avg(node_memory_MemTotal_bytes{job=\"node-exporter\", instance=\"$instance\"})\n* 100\n)\n","format":"time_series","intervalFactor":2,"legendFormat":""}],"title":"Memory Usage","transparent":false,"type":"gauge"}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"Memory","titleSize":"h6","type":"row"},{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","fill":0,"fillGradient":0,"gridPos":{},"id":6,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[{"alias":"/ read| written/","yaxis":1},{"alias":"/ io time/","yaxis":2}],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(node_disk_read_bytes_total{job=\"node-exporter\", instance=\"$instance\", device=~\"(/dev/)?(mmcblk.p.+|nvme.+|rbd.+|sd.+|vd.+|xvd.+|dm-.+|md.+|dasd.+)\"}[$__rate_interval])","format":"time_series","intervalFactor":1,"legendFormat":"{{device}} read","refId":"A"},{"expr":"rate(node_disk_written_bytes_total{job=\"node-exporter\", instance=\"$instance\", device=~\"(/dev/)?(mmcblk.p.+|nvme.+|rbd.+|sd.+|vd.+|xvd.+|dm-.+|md.+|dasd.+)\"}[$__rate_interval])","format":"time_series","intervalFactor":1,"legendFormat":"{{device}} written","refId":"B"},{"expr":"rate(node_disk_io_time_seconds_total{job=\"node-exporter\", instance=\"$instance\", device=~\"(/dev/)?(mmcblk.p.+|nvme.+|rbd.+|sd.+|vd.+|xvd.+|dm-.+|md.+|dasd.+)\"}[$__rate_interval])","format":"time_series","intervalFactor":1,"legendFormat":"{{device}} io time","refId":"C"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Disk I/O","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"percentunit","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"datasource":"$datasource","fieldConfig":{"defaults":{"custom":{},"thresholds":{"mode":"absolute","steps":[{"color":"green"},{"color":"yellow","value":0.8},{"color":"red","value":0.9}]},"unit":"decbytes"},"overrides":[{"matcher":{"id":"byName","options":"Mounted on"},"properties":[{"id":"custom.width","value":260}]},{"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"custom.width","value":93}]},{"matcher":{"id":"byName","options":"Used"},"properties":[{"id":"custom.width","value":72}]},{"matcher":{"id":"byName","options":"Available"},"properties":[{"id":"custom.width","value":88}]},{"matcher":{"id":"byName","options":"Used, %"},"properties":[{"id":"unit","value":"percentunit"},{"id":"custom.displayMode","value":"gradient-gauge"},{"id":"max","value":1},{"id":"min","value":0}]}]},"gridPos":{},"id":7,"span":6,"targets":[{"expr":"max by (mountpoint) (node_filesystem_size_bytes{job=\"node-exporter\", instance=\"$instance\", fstype!=\"\", mountpoint!=\"\"})\n","format":"table","instant":true,"intervalFactor":2,"legendFormat":""},{"expr":"max by (mountpoint) (node_filesystem_avail_bytes{job=\"node-exporter\", instance=\"$instance\", fstype!=\"\", mountpoint!=\"\"})\n","format":"table","instant":true,"intervalFactor":2,"legendFormat":""}],"title":"Disk Space Usage","transformations":[{"id":"groupBy","options":{"fields":{"Value #A":{"aggregations":["lastNotNull"],"operation":"aggregate"},"Value #B":{"aggregations":["lastNotNull"],"operation":"aggregate"},"mountpoint":{"aggregations":[],"operation":"groupby"}}}},{"id":"merge","options":{}},{"id":"calculateField","options":{"alias":"Used","binary":{"left":"Value #A (lastNotNull)","operator":"-","reducer":"sum","right":"Value #B (lastNotNull)"},"mode":"binary","reduce":{"reducer":"sum"}}},{"id":"calculateField","options":{"alias":"Used, %","binary":{"left":"Used","operator":"/","reducer":"sum","right":"Value #A (lastNotNull)"},"mode":"binary","reduce":{"reducer":"sum"}}},{"id":"organize","options":{"excludeByName":{},"indexByName":{},"renameByName":{"Value #A (lastNotNull)":"Size","Value #B (lastNotNull)":"Available","mountpoint":"Mounted on"}}},{"id":"sortBy","options":{"fields":{},"sort":[{"field":"Mounted on"}]}}],"transparent":false,"type":"table"}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"Disk","titleSize":"h6","type":"row"},{"collapse":false,"collapsed":false,"panels":[{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","description":"Network received (bits/s)","fill":0,"fillGradient":0,"gridPos":{},"id":8,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(node_network_receive_bytes_total{job=\"node-exporter\", instance=\"$instance\", device!=\"lo\"}[$__rate_interval]) * 8","format":"time_series","intervalFactor":1,"legendFormat":"{{device}}","refId":"A"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Network Received","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true}]},{"aliasColors":{},"bars":false,"dashLength":10,"dashes":false,"datasource":"$datasource","description":"Network transmitted (bits/s)","fill":0,"fillGradient":0,"gridPos":{},"id":9,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"rightSide":false,"show":true,"sideWidth":null,"total":false,"values":false},"lines":true,"linewidth":1,"links":[],"nullPointMode":"null","percentage":false,"pointradius":5,"points":false,"renderer":"flot","repeat":null,"seriesOverrides":[],"spaceLength":10,"span":6,"stack":false,"steppedLine":false,"targets":[{"expr":"rate(node_network_transmit_bytes_total{job=\"node-exporter\", instance=\"$instance\", device!=\"lo\"}[$__rate_interval]) * 8","format":"time_series","intervalFactor":1,"legendFormat":"{{device}}","refId":"A"}],"thresholds":[],"timeFrom":null,"timeShift":null,"title":"Network Transmitted","tooltip":{"shared":true,"sort":0,"value_type":"individual"},"type":"graph","xaxis":{"buckets":null,"mode":"time","name":null,"show":true,"values":[]},"yaxes":[{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bps","label":null,"logBase":1,"max":null,"min":0,"show":true}]}],"repeat":null,"repeatIteration":null,"repeatRowId":null,"showTitle":true,"title":"Network","titleSize":"h6","type":"row"}],"schemaVersion":14,"style":"dark","tags":["node-exporter-mixin"],"templating":{"list":[{"current":{"text":"default","value":"default"},"hide":0,"label":"Data Source","name":"datasource","options":[],"query":"prometheus","refresh":1,"regex":"","type":"datasource"},{"allValue":null,"current":{},"datasource":"$datasource","hide":0,"includeAll":false,"label":"Instance","multi":false,"name":"instance","options":[],"query":"label_values(node_uname_info{job=\"node-exporter\", sysname!=\"Darwin\"}, instance)","refresh":2,"regex":"","sort":0,"tagValuesQuery":"","tags":[],"tagsQuery":"","type":"query","useTags":false}]},"time":{"from":"now-1h","to":"now"},"timepicker":{"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"Node Exporter / Nodes","version":0}`}} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 99cc16186356..611ce608bbc5 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -1881,6 +1881,11 @@ kube-state-metrics: ## nodeExporter: enabled: true + operatingSystems: + linux: + enabled: true + darwin: + enabled: true ## Configuration for prometheus-node-exporter subchart ## From c48edfdd457ea3bba6e807ae387dfb715015edcb Mon Sep 17 00:00:00 2001 From: Brett Kochendorfer Date: Thu, 14 Sep 2023 22:17:23 -0500 Subject: [PATCH 10/15] feat: Add security context to fastly-exporter (#3790) Add ability to pass in SecurityContext and PodSecurityContext Signed-off-by: Brett Kochendorfer Co-authored-by: MH --- charts/prometheus-fastly-exporter/Chart.yaml | 2 +- .../prometheus-fastly-exporter/templates/deployment.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-fastly-exporter/Chart.yaml b/charts/prometheus-fastly-exporter/Chart.yaml index 93240e259506..51205eb43769 100644 --- a/charts/prometheus-fastly-exporter/Chart.yaml +++ b/charts/prometheus-fastly-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "7.2.4" description: A Helm chart for the Prometheus Fastly Exporter name: prometheus-fastly-exporter -version: 0.1.2 +version: 0.2.0 keywords: - metrics - fastly diff --git a/charts/prometheus-fastly-exporter/templates/deployment.yaml b/charts/prometheus-fastly-exporter/templates/deployment.yaml index b07014d8d693..00564d5c4330 100644 --- a/charts/prometheus-fastly-exporter/templates/deployment.yaml +++ b/charts/prometheus-fastly-exporter/templates/deployment.yaml @@ -22,6 +22,10 @@ spec: {{- with .Values.initContainers }} initContainers: {{ toYaml . | nindent 8 }} {{- end }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -55,6 +59,10 @@ spec: {{- with .Values.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.extraVolumeMounts }} volumeMounts: {{ toYaml . | nindent 12 }} {{- end }} From b8b561eca1df7d70f0cc1e19e831ad58cb8c37f0 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Tue, 19 Sep 2023 03:02:54 +0100 Subject: [PATCH 11/15] [prometheus] Apply templating to remote_read & remote_write config (#3777) * Apply templating to remote_read & remote_write config Signed-off-by: Garry O'Donnell * Add migration instructions for prometheus 25.0 Signed-off-by: Garry O'Donnell Signed-off-by: Garry O'Donnell * Only template URLs Signed-off-by: Garry O'Donnell Signed-off-by: Garry O'Donnell * Fix whitespace Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Garry O'Donnell --------- Signed-off-by: Garry O'Donnell Signed-off-by: Garry O'Donnell Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/README.md | 6 ++++++ charts/prometheus/templates/_helpers.tpl | 23 +++++++++++++++++++++++ charts/prometheus/templates/cm.yaml | 4 ++-- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index 53571bbfab10..7c5e61eccfb5 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: v2.47.0 -version: 24.5.0 +version: 25.0.0 kubeVersion: ">=1.19.0-0" description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/charts/prometheus/README.md b/charts/prometheus/README.md index 3246e3712b86..2cb744ce8f52 100644 --- a/charts/prometheus/README.md +++ b/charts/prometheus/README.md @@ -65,6 +65,12 @@ helm upgrade [RELEASE_NAME] prometheus-community/prometheus --install _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ +### To 25.0 + +The `server.remoteRead[].url` and `server.remoteWrite[].url` fields now support templating. Allowing for `url` values such as `https://{{ .Release.Name }}.example.com`. + +Any entries in these which previously included `{{` or `}}` must be escaped with `{{ "{{" }}` and `{{ "}}" }}` respectively. Entries which did not previously include the template-like syntax will not be affected. + ### To 24.0 Require Kubernetes 1.19+ diff --git a/charts/prometheus/templates/_helpers.tpl b/charts/prometheus/templates/_helpers.tpl index 0f4c631867bd..daec18e28052 100644 --- a/charts/prometheus/templates/_helpers.tpl +++ b/charts/prometheus/templates/_helpers.tpl @@ -211,3 +211,26 @@ Define template prometheus.namespaces producing a list of namespaces to monitor {{- end -}} {{ mustToJson $namespaces }} {{- end -}} + +{{/* +Define prometheus.server.remoteWrite producing a list of remoteWrite configurations with URL templating +*/}} +{{- define "prometheus.server.remoteWrite" -}} +{{- $remoteWrites := list }} +{{- range $remoteWrite := .Values.server.remoteWrite }} + {{- $remoteWrites = tpl $remoteWrite.url $ | set $remoteWrite "url" | append $remoteWrites }} +{{- end -}} +{{ toYaml $remoteWrites }} +{{- end -}} + +{{/* +Define prometheus.server.remoteRead producing a list of remoteRead configurations with URL templating +*/}} +{{- define "prometheus.server.remoteRead" -}} +{{- $remoteReads := list }} +{{- range $remoteRead := .Values.server.remoteRead }} + {{- $remoteReads = tpl $remoteRead.url $ | set $remoteRead "url" | append $remoteReads }} +{{- end -}} +{{ toYaml $remoteReads }} +{{- end -}} + diff --git a/charts/prometheus/templates/cm.yaml b/charts/prometheus/templates/cm.yaml index a702b527ee32..4e1ba70b84d1 100644 --- a/charts/prometheus/templates/cm.yaml +++ b/charts/prometheus/templates/cm.yaml @@ -22,11 +22,11 @@ data: {{ $root.Values.server.global | toYaml | trimSuffix "\n" | indent 6 }} {{- if $root.Values.server.remoteWrite }} remote_write: -{{ $root.Values.server.remoteWrite | toYaml | indent 4 }} +{{- include "prometheus.server.remoteWrite" $root | nindent 4 }} {{- end }} {{- if $root.Values.server.remoteRead }} remote_read: -{{ $root.Values.server.remoteRead | toYaml | indent 4 }} +{{- include "prometheus.server.remoteRead" $root | nindent 4 }} {{- end }} {{- if or $root.Values.server.tsdb $root.Values.server.exemplars }} storage: From fe84f27f22afb31e4455bf91fcfbf89ff70bb825 Mon Sep 17 00:00:00 2001 From: mmianl <101594482+mmianl@users.noreply.github.com> Date: Thu, 21 Sep 2023 13:17:20 +0200 Subject: [PATCH 12/15] =?UTF-8?q?[kube-prometheus-stack]=20remove=20defaul?= =?UTF-8?q?t=20cpu=20and=20memory=20requests=20and=20li=E2=80=A6=20(#3813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [kube-prometheus-stack] remove default cpu and memory requests and limits from prometheus config reloader (#3812) Signed-off-by: Markus Müllner * [kube-prometheus-stack] update prometheus operator deployment template (#3812) Signed-off-by: Markus Müllner * [kube-prometheus-stack] fix prometheus operator deployment template by wrapping nullable values (#3812) Signed-off-by: Markus Müllner * [kube-prometheus-stack] use default value instead of if in prometheus operator deployment template (#3812) Signed-off-by: Markus Müllner --------- Signed-off-by: Markus Müllner --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/prometheus-operator/deployment.yaml | 8 ++++---- charts/kube-prometheus-stack/values.yaml | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index b57ddcdddfdf..0d798928b608 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.0.3 +version: 51.1.0 appVersion: v0.68.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml b/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml index 1017a00bea5b..67d0024d1428 100644 --- a/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml @@ -91,10 +91,10 @@ spec: {{- else }} - --prometheus-config-reloader={{ $configReloaderRegistry }}/{{ .Values.prometheusOperator.prometheusConfigReloader.image.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloader.image.tag | default .Chart.AppVersion }} {{- end }} - - --config-reloader-cpu-request={{ .Values.prometheusOperator.prometheusConfigReloader.resources.requests.cpu }} - - --config-reloader-cpu-limit={{ .Values.prometheusOperator.prometheusConfigReloader.resources.limits.cpu }} - - --config-reloader-memory-request={{ .Values.prometheusOperator.prometheusConfigReloader.resources.requests.memory }} - - --config-reloader-memory-limit={{ .Values.prometheusOperator.prometheusConfigReloader.resources.limits.memory }} + - --config-reloader-cpu-request={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).requests).cpu) | default 0 }} + - --config-reloader-cpu-limit={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).limits).cpu) | default 0 }} + - --config-reloader-memory-request={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).requests).memory) | default 0 }} + - --config-reloader-memory-limit={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).limits).memory) | default 0 }} {{- if .Values.prometheusOperator.prometheusConfigReloader.enableProbe }} - --enable-config-reloader-probes=true {{- end }} diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 611ce608bbc5..697ef599f8d1 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -2377,13 +2377,13 @@ prometheusOperator: enableProbe: false # resource config for prometheusConfigReloader - resources: - requests: - cpu: 200m - memory: 50Mi - limits: - cpu: 200m - memory: 50Mi + resources: {} + # requests: + # cpu: 200m + # memory: 50Mi + # limits: + # cpu: 200m + # memory: 50Mi ## Thanos side-car image when configured ## From 9c8e405bb48741baff3f069daba4e3ae504f501b Mon Sep 17 00:00:00 2001 From: Markus Lippert Date: Fri, 22 Sep 2023 10:10:34 +0200 Subject: [PATCH 13/15] [kube-prometheus-stack] fix: use correct job name for dashboards to work, make deployment more intuitively (#3672) * fix: use correct job name for dashboards to work, make deployment more intuitively Signed-off-by: Markus Lippert * merge main Signed-off-by: Markus Lippert * bump version Signed-off-by: Markus Lippert --------- Signed-off-by: Markus Lippert --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../rules-1.14/windows.node.rules.yaml | 52 +++++++++---------- .../rules-1.14/windows.pod.rules.yaml | 12 ++--- charts/kube-prometheus-stack/values.yaml | 26 ++++++++-- 4 files changed, 56 insertions(+), 36 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 0d798928b608..2e5047d0b6c6 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.1.0 +version: 51.1.1 appVersion: v0.68.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml index 5a240947a3ba..42bcb1c8d883 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml @@ -26,41 +26,41 @@ spec: rules: - expr: |- count ( - windows_system_system_up_time{job="{{ .Values.windowsMonitoring.job }}"} + windows_system_system_up_time{job="windows-exporter"} ) record: node:windows_node:sum - expr: |- count by (instance) (sum by (instance, core) ( - windows_cpu_time_total{job="{{ .Values.windowsMonitoring.job }}"} + windows_cpu_time_total{job="windows-exporter"} )) record: node:windows_node_num_cpu:sum - - expr: 1 - avg(rate(windows_cpu_time_total{job="{{ .Values.windowsMonitoring.job }}",mode="idle"}[1m])) + - expr: 1 - avg(rate(windows_cpu_time_total{job="windows-exporter",mode="idle"}[1m])) record: :windows_node_cpu_utilisation:avg1m - expr: |- 1 - avg by (instance) ( - rate(windows_cpu_time_total{job="{{ .Values.windowsMonitoring.job }}",mode="idle"}[1m]) + rate(windows_cpu_time_total{job="windows-exporter",mode="idle"}[1m]) ) record: node:windows_node_cpu_utilisation:avg1m - expr: |- 1 - - sum(windows_memory_available_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + sum(windows_memory_available_bytes{job="windows-exporter"}) / - sum(windows_os_visible_memory_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + sum(windows_os_visible_memory_bytes{job="windows-exporter"}) record: ':windows_node_memory_utilisation:' - - expr: sum(windows_memory_available_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_cache_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: sum(windows_memory_available_bytes{job="windows-exporter"} + windows_memory_cache_bytes{job="windows-exporter"}) record: :windows_node_memory_MemFreeCached_bytes:sum - - expr: (windows_memory_cache_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_modified_page_list_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_standby_cache_core_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_standby_cache_normal_priority_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_standby_cache_reserve_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: (windows_memory_cache_bytes{job="windows-exporter"} + windows_memory_modified_page_list_bytes{job="windows-exporter"} + windows_memory_standby_cache_core_bytes{job="windows-exporter"} + windows_memory_standby_cache_normal_priority_bytes{job="windows-exporter"} + windows_memory_standby_cache_reserve_bytes{job="windows-exporter"}) record: node:windows_node_memory_totalCached_bytes:sum - - expr: sum(windows_os_visible_memory_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: sum(windows_os_visible_memory_bytes{job="windows-exporter"}) record: :windows_node_memory_MemTotal_bytes:sum - expr: |- sum by (instance) ( - (windows_memory_available_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + (windows_memory_available_bytes{job="windows-exporter"}) ) record: node:windows_node_memory_bytes_available:sum - expr: |- sum by (instance) ( - windows_os_visible_memory_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_os_visible_memory_bytes{job="windows-exporter"} ) record: node:windows_node_memory_bytes_total:sum - expr: |- @@ -70,43 +70,43 @@ spec: record: node:windows_node_memory_utilisation:ratio - expr: 1 - (node:windows_node_memory_bytes_available:sum / node:windows_node_memory_bytes_total:sum) record: 'node:windows_node_memory_utilisation:' - - expr: irate(windows_memory_swap_page_operations_total{job="{{ .Values.windowsMonitoring.job }}"}[5m]) + - expr: irate(windows_memory_swap_page_operations_total{job="windows-exporter"}[5m]) record: node:windows_node_memory_swap_io_pages:irate - expr: |- - avg(irate(windows_logical_disk_read_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + - irate(windows_logical_disk_write_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + avg(irate(windows_logical_disk_read_seconds_total{job="windows-exporter"}[1m]) + + irate(windows_logical_disk_write_seconds_total{job="windows-exporter"}[1m]) ) record: :windows_node_disk_utilisation:avg_irate - expr: |- avg by (instance) ( - (irate(windows_logical_disk_read_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + - irate(windows_logical_disk_write_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + (irate(windows_logical_disk_read_seconds_total{job="windows-exporter"}[1m]) + + irate(windows_logical_disk_write_seconds_total{job="windows-exporter"}[1m])) ) record: node:windows_node_disk_utilisation:avg_irate - expr: |- max by (instance,volume)( - (windows_logical_disk_size_bytes{job="{{ .Values.windowsMonitoring.job }}"} - - windows_logical_disk_free_bytes{job="{{ .Values.windowsMonitoring.job }}"}) - / windows_logical_disk_size_bytes{job="{{ .Values.windowsMonitoring.job }}"} + (windows_logical_disk_size_bytes{job="windows-exporter"} + - windows_logical_disk_free_bytes{job="windows-exporter"}) + / windows_logical_disk_size_bytes{job="windows-exporter"} ) record: 'node:windows_node_filesystem_usage:' - - expr: max by (instance, volume) (windows_logical_disk_free_bytes{job="{{ .Values.windowsMonitoring.job }}"} / windows_logical_disk_size_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: max by (instance, volume) (windows_logical_disk_free_bytes{job="windows-exporter"} / windows_logical_disk_size_bytes{job="windows-exporter"}) record: 'node:windows_node_filesystem_avail:' - - expr: sum(irate(windows_net_bytes_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + - expr: sum(irate(windows_net_bytes_total{job="windows-exporter"}[1m])) record: :windows_node_net_utilisation:sum_irate - expr: |- sum by (instance) ( - (irate(windows_net_bytes_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + (irate(windows_net_bytes_total{job="windows-exporter"}[1m])) ) record: node:windows_node_net_utilisation:sum_irate - expr: |- - sum(irate(windows_net_packets_received_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + - sum(irate(windows_net_packets_outbound_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + sum(irate(windows_net_packets_received_discarded_total{job="windows-exporter"}[1m])) + + sum(irate(windows_net_packets_outbound_discarded_total{job="windows-exporter"}[1m])) record: :windows_node_net_saturation:sum_irate - expr: |- sum by (instance) ( - (irate(windows_net_packets_received_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + - irate(windows_net_packets_outbound_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + (irate(windows_net_packets_received_discarded_total{job="windows-exporter"}[1m]) + + irate(windows_net_packets_outbound_discarded_total{job="windows-exporter"}[1m])) ) record: node:windows_node_net_saturation:sum_irate {{- end }} diff --git a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml index e953a493fb49..5ce2f0371f59 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml @@ -24,17 +24,17 @@ spec: groups: - name: windows.pod.rules rules: - - expr: windows_container_available{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_available{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_pod_container_available - - expr: windows_container_cpu_usage_seconds_total{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_cpu_usage_seconds_total{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_total_runtime - - expr: windows_container_memory_usage_commit_bytes{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_memory_usage_commit_bytes{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_memory_usage - - expr: windows_container_memory_usage_private_working_set_bytes{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_memory_usage_private_working_set_bytes{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_private_working_set_usage - - expr: windows_container_network_receive_bytes_total{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_network_receive_bytes_total{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_network_received_bytes_total - - expr: windows_container_network_transmit_bytes_total{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_network_transmit_bytes_total{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_network_transmitted_bytes_total - expr: |- max by (namespace, pod, container) ( diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 697ef599f8d1..ea152cf71594 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -201,10 +201,30 @@ global: # - "image-pull-secret" windowsMonitoring: - ## Deploys the windows-exporter and Windows-specific dashboards and rules + ## Deploys the windows-exporter and Windows-specific dashboards and rules (job name must be 'windows-exporter') enabled: false - ## Job must match jobLabel in the PodMonitor/ServiceMonitor and is used for the rules - job: prometheus-windows-exporter + +## Configuration for prometheus-windows-exporter +## ref: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-windows-exporter +## +prometheus-windows-exporter: + ## Enable ServiceMonitor and set Kubernetes label to use as a job label + ## + prometheus: + monitor: + enabled: true + jobLabel: jobLabel + + ## Set job label to 'windows-exporter' as required by the default Prometheus rules and Grafana dashboards + ## + podLabels: + jobLabel: windows-exporter + + ## Enable memory and container metrics as required by the default Prometheus rules and Grafana dashboards + ## + config: |- + collectors: + enabled: '[defaults],memory,container' ## Configuration for alertmanager ## ref: https://prometheus.io/docs/alerting/alertmanager/ From 93a23644c32f30217841a7ea40b7f43b210ac711 Mon Sep 17 00:00:00 2001 From: tylenwells <47961949+tylenwells@users.noreply.github.com> Date: Sat, 23 Sep 2023 00:38:39 -0700 Subject: [PATCH 14/15] [prometheus-statsd-exporter] fix hpaspec for autoscaling/v2 (#3681) * fix hpaspec for autoscaling/v2 Signed-off-by: Tylen Wells * Use helper template in conditional Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --------- Signed-off-by: Tylen Wells Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> Co-authored-by: Tylen Wells Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus-statsd-exporter/Chart.yaml | 2 +- .../templates/hpa.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-statsd-exporter/Chart.yaml b/charts/prometheus-statsd-exporter/Chart.yaml index 2551f880289e..48092f9ab19c 100644 --- a/charts/prometheus-statsd-exporter/Chart.yaml +++ b/charts/prometheus-statsd-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus-statsd-exporter description: A Helm chart for prometheus stats-exporter -version: 0.10.0 +version: 0.10.1 appVersion: v0.24.0 home: https://github.com/prometheus/statsd_exporter sources: diff --git a/charts/prometheus-statsd-exporter/templates/hpa.yaml b/charts/prometheus-statsd-exporter/templates/hpa.yaml index 4d04994993dc..9c0fa614b072 100644 --- a/charts/prometheus-statsd-exporter/templates/hpa.yaml +++ b/charts/prometheus-statsd-exporter/templates/hpa.yaml @@ -13,6 +13,24 @@ spec: minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: + {{- if eq (include "prometheus-statsd-exporter.hpa.apiVersion" .) "autoscaling/v2" -}} + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} + {{- else -}} {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: @@ -24,5 +42,6 @@ spec: resource: name: memory targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end -}} {{- end }} {{- end }} From 1a60cd7555e3f1a0239c28aee04a767a571a6ad9 Mon Sep 17 00:00:00 2001 From: zeritti <47476160+zeritti@users.noreply.github.com> Date: Sun, 24 Sep 2023 01:28:01 +0200 Subject: [PATCH 15/15] Add support for attaching node metadata (#3820) * Add support for attachMetadata in service monitor for kubelet endpoint available since Prometheus 2.45.0 Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/exporters/kubelet/servicemonitor.yaml | 4 ++++ charts/kube-prometheus-stack/values.yaml | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 2e5047d0b6c6..c6a759c6d8a8 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.1.1 +version: 51.2.0 appVersion: v0.68.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml index 10de33955e2b..e5ad637ebba1 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml @@ -12,6 +12,10 @@ metadata: {{- include "kube-prometheus-stack.labels" . | indent 4 }} spec: {{- include "servicemonitor.scrapeLimits" .Values.kubelet.serviceMonitor | nindent 2 }} + {{- with .Values.kubelet.serviceMonitor.attachMetadata }} + attachMetadata: + {{- toYaml . | nindent 4 }} + {{- end }} endpoints: {{- if .Values.kubelet.serviceMonitor.https }} - port: https-metrics diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index ea152cf71594..2ad07b069cb6 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -1150,6 +1150,11 @@ kubelet: namespace: kube-system serviceMonitor: + ## Attach metadata to discovered targets. Requires Prometheus v2.45 for endpoints created by the operator. + ## + attachMetadata: + node: false + ## Scrape interval. If not set, the Prometheus default scrape interval is used. ## interval: ""