-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jan-Otto Kröpke <[email protected]>
- Loading branch information
Showing
7 changed files
with
484 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...us-stack/templates/prometheus/rules-1.14/k8s.rules.container_cpu_usage_seconds_total.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{- /* | ||
Generated from 'k8s.rules.container_cpu_usage_seconds_total' group from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml | ||
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 (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "k8s.rules.container_cpu_usage_seconds_total" | trunc 63 | trimSuffix "-" }} | ||
namespace: {{ template "kube-prometheus-stack.namespace" . }} | ||
labels: | ||
app: {{ template "kube-prometheus-stack.name" . }} | ||
{{ include "kube-prometheus-stack.labels" . | indent 4 }} | ||
{{- if .Values.defaultRules.labels }} | ||
{{ toYaml .Values.defaultRules.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.defaultRules.annotations }} | ||
annotations: | ||
{{ toYaml .Values.defaultRules.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
- name: k8s.rules.container_cpu_usage_seconds_total | ||
rules: | ||
- expr: |- | ||
sum by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod, container) ( | ||
irate(container_cpu_usage_seconds_total{job="kubelet", metrics_path="/metrics/cadvisor", image!=""}[5m]) | ||
) * on ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) group_left(node) topk by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) ( | ||
1, max by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod, node) (kube_pod_info{node!=""}) | ||
) | ||
record: node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate | ||
{{- if or .Values.defaultRules.additionalRuleLabels }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
42 changes: 42 additions & 0 deletions
42
...be-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.container_memory_cache.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- /* | ||
Generated from 'k8s.rules.container_memory_cache' group from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml | ||
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 (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "k8s.rules.container_memory_cache" | trunc 63 | trimSuffix "-" }} | ||
namespace: {{ template "kube-prometheus-stack.namespace" . }} | ||
labels: | ||
app: {{ template "kube-prometheus-stack.name" . }} | ||
{{ include "kube-prometheus-stack.labels" . | indent 4 }} | ||
{{- if .Values.defaultRules.labels }} | ||
{{ toYaml .Values.defaultRules.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.defaultRules.annotations }} | ||
annotations: | ||
{{ toYaml .Values.defaultRules.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
- name: k8s.rules.container_memory_cache | ||
rules: | ||
- expr: |- | ||
container_memory_cache{job="kubelet", metrics_path="/metrics/cadvisor", image!=""} | ||
* on ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) group_left(node) topk by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) (1, | ||
max by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod, node) (kube_pod_info{node!=""}) | ||
) | ||
record: node_namespace_pod_container:container_memory_cache | ||
{{- if or .Values.defaultRules.additionalRuleLabels }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
42 changes: 42 additions & 0 deletions
42
...kube-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.container_memory_rss.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- /* | ||
Generated from 'k8s.rules.container_memory_rss' group from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml | ||
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 (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "k8s.rules.container_memory_rss" | trunc 63 | trimSuffix "-" }} | ||
namespace: {{ template "kube-prometheus-stack.namespace" . }} | ||
labels: | ||
app: {{ template "kube-prometheus-stack.name" . }} | ||
{{ include "kube-prometheus-stack.labels" . | indent 4 }} | ||
{{- if .Values.defaultRules.labels }} | ||
{{ toYaml .Values.defaultRules.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.defaultRules.annotations }} | ||
annotations: | ||
{{ toYaml .Values.defaultRules.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
- name: k8s.rules.container_memory_rss | ||
rules: | ||
- expr: |- | ||
container_memory_rss{job="kubelet", metrics_path="/metrics/cadvisor", image!=""} | ||
* on ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) group_left(node) topk by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) (1, | ||
max by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod, node) (kube_pod_info{node!=""}) | ||
) | ||
record: node_namespace_pod_container:container_memory_rss | ||
{{- if or .Values.defaultRules.additionalRuleLabels }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
42 changes: 42 additions & 0 deletions
42
...ube-prometheus-stack/templates/prometheus/rules-1.14/k8s.rules.container_memory_swap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- /* | ||
Generated from 'k8s.rules.container_memory_swap' group from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml | ||
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 (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "k8s.rules.container_memory_swap" | trunc 63 | trimSuffix "-" }} | ||
namespace: {{ template "kube-prometheus-stack.namespace" . }} | ||
labels: | ||
app: {{ template "kube-prometheus-stack.name" . }} | ||
{{ include "kube-prometheus-stack.labels" . | indent 4 }} | ||
{{- if .Values.defaultRules.labels }} | ||
{{ toYaml .Values.defaultRules.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.defaultRules.annotations }} | ||
annotations: | ||
{{ toYaml .Values.defaultRules.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
- name: k8s.rules.container_memory_swap | ||
rules: | ||
- expr: |- | ||
container_memory_swap{job="kubelet", metrics_path="/metrics/cadvisor", image!=""} | ||
* on ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) group_left(node) topk by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) (1, | ||
max by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod, node) (kube_pod_info{node!=""}) | ||
) | ||
record: node_namespace_pod_container:container_memory_swap | ||
{{- if or .Values.defaultRules.additionalRuleLabels }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
42 changes: 42 additions & 0 deletions
42
...s-stack/templates/prometheus/rules-1.14/k8s.rules.container_memory_working_set_bytes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- /* | ||
Generated from 'k8s.rules.container_memory_working_set_bytes' group from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml | ||
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 (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "k8s.rules.container_memory_working_set_bytes" | trunc 63 | trimSuffix "-" }} | ||
namespace: {{ template "kube-prometheus-stack.namespace" . }} | ||
labels: | ||
app: {{ template "kube-prometheus-stack.name" . }} | ||
{{ include "kube-prometheus-stack.labels" . | indent 4 }} | ||
{{- if .Values.defaultRules.labels }} | ||
{{ toYaml .Values.defaultRules.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.defaultRules.annotations }} | ||
annotations: | ||
{{ toYaml .Values.defaultRules.annotations | indent 4 }} | ||
{{- end }} | ||
spec: | ||
groups: | ||
- name: k8s.rules.container_memory_working_set_bytes | ||
rules: | ||
- expr: |- | ||
container_memory_working_set_bytes{job="kubelet", metrics_path="/metrics/cadvisor", image!=""} | ||
* on ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) group_left(node) topk by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod) (1, | ||
max by ({{ range $.Values.defaultRules.additionalAggregationLabels }}{{ . }},{{ end }}cluster, namespace, pod, node) (kube_pod_info{node!=""}) | ||
) | ||
record: node_namespace_pod_container:container_memory_working_set_bytes | ||
{{- if or .Values.defaultRules.additionalRuleLabels }} | ||
labels: | ||
{{- with .Values.defaultRules.additionalRuleLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.