Add rules files to prometheus dynamically
This dynamically adds the rules files for prometheus to the prometheus-etc configmap, and also dynamically adds volume mounts to the prometheus statefulset for each rules file This also removes the empty rules file trees in the prometheus values.yaml file Change-Id: I9acbbe57d71a23f69e9e172b2f3ad66985e99574
This commit is contained in:
parent
457ff9552b
commit
a153f5474f
@ -24,26 +24,8 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
prometheus.yml: |+
|
prometheus.yml: |+
|
||||||
{{ toYaml .Values.conf.prometheus.scrape_configs | indent 4 }}
|
{{ toYaml .Values.conf.prometheus.scrape_configs | indent 4 }}
|
||||||
alertmanager.rules: |+
|
{{ range $key, $value := .Values.conf.prometheus.rules }}
|
||||||
{{ toYaml .Values.conf.prometheus.rules.alertmanager | indent 4 }}
|
{{ $key }}.rules: |+
|
||||||
etcd3.rules: |+
|
{{ toYaml $value | indent 4 }}
|
||||||
{{ toYaml .Values.conf.prometheus.rules.etcd3 | indent 4 }}
|
{{ end }}
|
||||||
kube-apiserver.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.kube_apiserver | indent 4 }}
|
|
||||||
kube-controller-manager.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.kube_controller_manager | indent 4 }}
|
|
||||||
kubelet.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.kubelet | indent 4 }}
|
|
||||||
kubernetes.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.kubernetes | indent 4 }}
|
|
||||||
rabbitmq.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.rabbitmq | indent 4 }}
|
|
||||||
mysql.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.mysql | indent 4 }}
|
|
||||||
ceph.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.ceph | indent 4 }}
|
|
||||||
openstack.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.openstack | indent 4 }}
|
|
||||||
custom.rules: |+
|
|
||||||
{{ toYaml .Values.conf.prometheus.rules.custom | indent 4 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -92,50 +92,12 @@ spec:
|
|||||||
mountPath: /etc/config
|
mountPath: /etc/config
|
||||||
- name: rulesprometheus
|
- name: rulesprometheus
|
||||||
mountPath: /etc/config/rules
|
mountPath: /etc/config/rules
|
||||||
|
{{- range $key, $value := .Values.conf.prometheus.rules }}
|
||||||
- name: prometheus-etc
|
- name: prometheus-etc
|
||||||
mountPath: /etc/config/rules/alertmanager.rules
|
mountPath: /etc/config/rules/{{ $key }}.rules
|
||||||
subPath: alertmanager.rules
|
subPath: {{ $key }}.rules
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/etcd3.rules
|
|
||||||
subPath: etcd3.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/kubernetes.rules
|
|
||||||
subPath: kubernetes.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/kube-apiserver.rules
|
|
||||||
subPath: kube-apiserver.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/kube-controller-manager.rules
|
|
||||||
subPath: kube-controller-manager.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/kubelet.rules
|
|
||||||
subPath: kubelet.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/rabbitmq.rules
|
|
||||||
subPath: rabbitmq.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/mysql.rules
|
|
||||||
subPath: mysql.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/ceph.rules
|
|
||||||
subPath: ceph.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/openstack.rules
|
|
||||||
subPath: openstack.rules
|
|
||||||
readOnly: true
|
|
||||||
- name: prometheus-etc
|
|
||||||
mountPath: /etc/config/rules/custom.rules
|
|
||||||
subPath: custom.rules
|
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
- name: prometheus-etc
|
- name: prometheus-etc
|
||||||
mountPath: /etc/config/prometheus.yml
|
mountPath: /etc/config/prometheus.yml
|
||||||
subPath: prometheus.yml
|
subPath: prometheus.yml
|
||||||
|
@ -207,15 +207,9 @@ conf:
|
|||||||
- /etc/config/rules/alertmanager.rules
|
- /etc/config/rules/alertmanager.rules
|
||||||
- /etc/config/rules/etcd3.rules
|
- /etc/config/rules/etcd3.rules
|
||||||
- /etc/config/rules/kubernetes.rules
|
- /etc/config/rules/kubernetes.rules
|
||||||
- /etc/config/rules/kube-apiserver.rules
|
- /etc/config/rules/kube_apiserver.rules
|
||||||
- /etc/config/rules/kube-controller-manager.rules
|
- /etc/config/rules/kube_controller_manager.rules
|
||||||
- /etc/config/rules/kubelet.rules
|
- /etc/config/rules/kubelet.rules
|
||||||
- /etc/config/rules/kube-scheduler.rules
|
|
||||||
- /etc/config/rules/rabbitmq.rules
|
|
||||||
- /etc/config/rules/mysql.rules
|
|
||||||
- /etc/config/rules/ceph.rules
|
|
||||||
- /etc/config/rules/openstack.rules
|
|
||||||
- /etc/config/rules/custom.rules
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: kubelet
|
- job_name: kubelet
|
||||||
scheme: https
|
scheme: https
|
||||||
@ -768,8 +762,3 @@ conf:
|
|||||||
expr: histogram_quantile(0.5, sum(scheduler_binding_latency_microseconds_bucket) BY (le, cluster)) / 1e+06
|
expr: histogram_quantile(0.5, sum(scheduler_binding_latency_microseconds_bucket) BY (le, cluster)) / 1e+06
|
||||||
labels:
|
labels:
|
||||||
quantile: "0.5"
|
quantile: "0.5"
|
||||||
rabbitmq: null
|
|
||||||
mysql: null
|
|
||||||
ceph: null
|
|
||||||
openstack: null
|
|
||||||
custom: null
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user