Add istio for prometheus

This commit is contained in:
Stefan Reimer 2020-08-03 17:44:58 +01:00
parent 3682efcdf1
commit f6da71451e
4 changed files with 39 additions and 4 deletions

View File

@ -14,3 +14,20 @@ spec:
- destination: - destination:
host: metrics-grafana host: metrics-grafana
{{- end }} {{- end }}
---
{{- if .Values.prometheus.istio.enabled }}
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: prometheus
namespace: monitoring
spec:
hosts:
- {{ .Values.prometheus.istio.url }}
gateways:
- {{ .Values.prometheus.istio.gateway }}
http:
- route:
- destination:
host: metrics-prometheus-operato-prometheus
{{- end }}

View File

@ -4,6 +4,12 @@ grafana:
url: "" url: ""
gateway: ingressgateway.istio-system.svc.cluster.local gateway: ingressgateway.istio-system.svc.cluster.local
prometheus:
istio:
enabled: false
url: ""
gateway: ingressgateway.istio-system.svc.cluster.local
prometheus-operator: prometheus-operator:
defaultRules: defaultRules:
create: true create: true
@ -64,7 +70,9 @@ prometheus-operator:
enabled: true enabled: true
prometheusSpec: prometheusSpec:
retention: 10d retention: 8d
portName: http-prometheus
resources: resources:
requests: requests:
memory: 512Mi memory: 512Mi

View File

@ -95,10 +95,17 @@ kubezero:
metrics: metrics:
enabled: {{ .Values.metrics.enabled }} enabled: {{ .Values.metrics.enabled }}
values: values:
{{- if and .Values.metrics.istio.enabled .Values.istio.enabled }} {{- if and .Values.metrics.istio.grafana.enabled .Values.istio.enabled }}
grafana: grafana:
istio: istio:
{{- with .Values.metrics.istio }} {{- with .Values.metrics.istio.grafana }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if and .Values.metrics.istio.prometheus.enabled .Values.istio.enabled }}
prometheus:
istio:
{{- with .Values.metrics.istio.prometheus }}
{{- toYaml . | nindent 10 }} {{- toYaml . | nindent 10 }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -28,7 +28,10 @@ istio:
metrics: metrics:
enabled: false enabled: false
istio: istio:
enabled: false grafana:
enabled: false
prometheus:
enabled: false
# Deprecated once metrics goes live # Deprecated once metrics goes live
prometheus: prometheus: