KubeZero/charts/kubezero/templates/metrics.yaml

96 lines
2.5 KiB
YAML
Raw Normal View History

{{- define "_kube-prometheus-stack" }}
{{- if .global.aws }}
alertmanager:
config:
receivers:
- name: 'null'
- name: alerthub-notifications
webhook_configs:
- send_resolved: true
url: http://localhost:9087/alert/AlertHub
route:
receiver: alerthub-notifications
prometheus:
prometheusSpec:
externalLabels:
awsAccount: '{{ .global.aws.accountId }}'
awsRegion: {{ .global.aws.region }}
clusterName: {{ .global.clusterName }}
volumes:
- name: aws-token
projected:
sources:
- serviceAccountToken:
path: token
expirationSeconds: 86400
audience: "sts.amazonaws.com"
volumeMounts:
- name: aws-token
mountPath: "/var/run/secrets/sts.amazonaws.com/serviceaccount/"
readOnly: true
additionalScrapeConfigs:
- job_name: 'nodes'
ec2_sd_configs:
- port: 9100
region: {{ .global.aws.region }}
filters:
- name: 'tag-key'
values: ['zdt:prometheus.node-exporter']
relabel_configs:
- source_labels:
- '__meta_ec2_instance_id'
target_label: 'instance_id'
- source_labels:
- '__meta_ec2_availability_zone'
target_label: 'availability_zone'
- source_labels:
- '__meta_ec2_private_dns_name'
target_label: 'instance'
- source_labels:
- '__meta_ec2_tag_Name'
target_label: 'instance'
{{- end }}
{{- end }}
2020-11-26 13:21:10 +00:00
{{- define "metrics-values" }}
{{- with .Values.metrics.istio }}
istio:
{{- toYaml . | nindent 2 }}
2020-11-26 13:21:10 +00:00
{{- end }}
2021-07-21 13:15:47 +00:00
{{- with index .Values "metrics" "kube-prometheus-stack" }}
2020-11-26 13:21:10 +00:00
kube-prometheus-stack:
{{- toYaml ( merge ( include "_kube-prometheus-stack" $.Values | fromYaml ) . ) | nindent 2 }}
2020-11-26 13:21:10 +00:00
{{- end }}
2021-07-21 13:15:47 +00:00
{{- with index .Values "metrics" "prometheus-adapter" }}
prometheus-adapter:
{{- toYaml . | nindent 2 }}
2021-07-21 13:15:47 +00:00
{{- end }}
{{- with index .Values "metrics" "prometheus-pushgateway" }}
prometheus-pushgateway:
{{- toYaml . | nindent 2 }}
{{- end }}
2020-11-26 13:21:10 +00:00
{{- end }}
{{- define "metrics-argo" }}
2020-11-24 15:29:38 +00:00
ignoreDifferences:
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/0/failurePolicy
- group: admissionregistration.k8s.io
kind: MutatingWebhookConfiguration
jsonPointers:
- /webhooks/0/failurePolicy
2020-07-30 17:18:32 +00:00
{{- end }}
2020-11-26 13:21:10 +00:00
{{ include "kubezero-app.app" . }}