0
votes

What is the difference between rules and rules1.14 in Prometheus operator? When is rules or rules1.14 used?

https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/templates/prometheus .

I see both have same rules but with some differences.Like CPUThrottlingHIGH rule exist in both folders but rules1.14 has it as "info" and rules folder has it as "warning".

1

1 Answers

1
votes

1.14 term is referring to the Kubernetes version.

When your Kubernetes version is in 1.10 <= version <1.14, rules from rules directory is created.

You will find the following line at the beginning of every YAML files in the rules directory:

{{- if and (semverCompare ">=1.10.0-0" $kubeTargetVersion) (semverCompare "<1.14.0-0" $kubeTargetVersion) .Values.defaultRules.create .Values.defaultRules.rules.alertmanager }}

Similarly, when your Kubernetes version is in version >= 1.14, rules from rules-1.14 directory is created.

{{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create .Values.kubeEtcd.enabled .Values.defaultRules.rules.etcd }}