Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ data:
path_prefix: {{ template "pulsar.control_center_path.alertmanager" . }}/
{{- end }}
scrape_configs:
{{- if .Values.prometheus.customScrapeConfigs -}}
{{- with .Values.prometheus.customScrapeConfigs }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- else }}
- job_name: 'prometheus'
static_configs:
- targets:
Expand Down Expand Up @@ -107,7 +112,7 @@ data:
{{ toYaml . | indent 6 }}
{{- end }}
{{- end }}
{{- if .Values.prometheus.serviceAccount.clusterRole }}
{{- if and .Values.prometheus.serviceAccount.clusterRole (or (not (hasKey .Values.prometheus.scrape "kubernetesNodes")) (eq .Values.prometheus.scrape.kubernetesNodes true)) }}
- job_name: 'kubernetes-nodes'
scheme: https
kubernetes_sd_configs:
Expand All @@ -126,6 +131,8 @@ data:
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics
{{- end }}
{{- if and .Values.prometheus.serviceAccount.clusterRole (or (not (hasKey .Values.prometheus.scrape "kubernetesCadvisor")) (eq .Values.prometheus.scrape.kubernetesCadvisor true)) }}
- job_name: 'kubernetes-cadvisor'
scheme: https
kubernetes_sd_configs:
Expand Down Expand Up @@ -154,6 +161,7 @@ data:
{{- with .Values.prometheus.extraCustomArgs }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
rules.yml: |
{{- if .Values.monitoring.alert_manager -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rules:
resources:
- nodes
- nodes/proxy
- nodes/metrics
- services
- endpoints
- pods
Expand Down
5 changes: 5 additions & 0 deletions charts/sn-platform-slim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,10 @@ prometheus:
node_exporter: true
proxy: true
zookeeper: true
# Enable scraping of kubernetes nodes metrics
kubernetesNodes: true
# Enable scraping of kubernetes cadvisor metrics
kubernetesCadvisor: true
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
labels: {}
Expand Down Expand Up @@ -2026,6 +2030,7 @@ prometheus:
customRelabelConfigs: []
extraScrapeConfigs: []
extraCustomArgs: {}
customScrpaConfigs: []

## Prometheus service
## templates/prometheus-service.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ data:
path_prefix: {{ template "pulsar.control_center_path.alertmanager" . }}/
{{- end }}
scrape_configs:
{{- if .Values.prometheus.customScrapeConfigs -}}
{{- with .Values.prometheus.customScrapeConfigs }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- else }}
- job_name: 'prometheus'
static_configs:
- targets:
Expand Down Expand Up @@ -107,7 +112,7 @@ data:
{{ toYaml . | indent 6 }}
{{- end }}
{{- end }}
{{- if .Values.prometheus.serviceAccount.clusterRole }}
{{- if and .Values.prometheus.serviceAccount.clusterRole (or (not (hasKey .Values.prometheus.scrape "kubernetesNodes")) (eq .Values.prometheus.scrape.kubernetesNodes true)) }}
- job_name: 'kubernetes-nodes'
scheme: https
kubernetes_sd_configs:
Expand All @@ -126,6 +131,8 @@ data:
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics
{{- end }}
{{- if and .Values.prometheus.serviceAccount.clusterRole (or (not (hasKey .Values.prometheus.scrape "kubernetesCadvisor")) (eq .Values.prometheus.scrape.kubernetesCadvisor true)) }}
- job_name: 'kubernetes-cadvisor'
scheme: https
kubernetes_sd_configs:
Expand Down Expand Up @@ -154,6 +161,7 @@ data:
{{- with .Values.prometheus.extraCustomArgs }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
rules.yml: |
{{- if .Values.monitoring.alert_manager -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rules:
resources:
- nodes
- nodes/proxy
- nodes/metrics
- services
- endpoints
- pods
Expand Down
6 changes: 6 additions & 0 deletions charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,10 @@ prometheus:
proxy: true
zookeeper: true
vault: true
# Enable scraping of kubernetes nodes metrics
kubernetesNodes: true
# Enable scraping of kubernetes cadvisor metrics
kubernetesCadvisor: true
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
labels: {}
Expand Down Expand Up @@ -2107,6 +2111,8 @@ prometheus:
customRelabelConfigs: []
extraScrapeConfigs: []
extraCustomArgs: {}
# A advanced configuration to add custom scrape configs.
customScrapeConfigs: []

## Prometheus service
## templates/prometheus-service.yaml
Expand Down
Loading