feat: Add Istio Grafana dashboards, enable metrics

This commit is contained in:
Stefan Reimer 2021-04-25 11:58:17 +02:00
parent 2dc64d7b1b
commit 11f7544912
9 changed files with 84 additions and 11 deletions

View File

@ -0,0 +1 @@
../kubezero-istio/.helmignore

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero-istio-ingress
description: KubeZero Umbrella Chart for Istio based Ingress
type: application
version: 0.5.5
version: 0.5.6
appVersion: 1.9.3
home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png

View File

@ -3,9 +3,9 @@ apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: envoy-stats-monitor
namespace: istio-ingress
namespace: {{ .Release.Namespace }}
labels:
release: metrics
{{ include "kubezero-lib.labels" . | indent 4 }}
spec:
selector:
matchExpressions:
@ -13,7 +13,6 @@ spec:
jobLabel: envoy-stats
podMetricsEndpoints:
- path: /stats/prometheus
interval: 30s
relabelings:
- action: keep
sourceLabels: [__meta_kubernetes_pod_container_name]

View File

@ -1,2 +1,31 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
README.md.gotmpl
*.patch
*.sh
*.py
istioctl
istio-?.?.?

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero-istio
description: KubeZero Umbrella Chart for Istio
type: application
version: 0.5.5
version: 0.5.6
appVersion: 1.9.3
home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png

View File

@ -0,0 +1,21 @@
configmap: grafana-dashboards
gzip: true
folder: Istio
condition: 'index .Values "istio-discovery" "telemetry" "enabled"'
dashboards:
- name: istio-control-plane
url: https://grafana.com/api/dashboards/7645/revisions/60/download
tags:
- Istio
- name: istio-mesh
url: https://grafana.com/api/dashboards/7639/revisions/60/download
tags:
- Istio
- name: istio-service
url: https://grafana.com/api/dashboards/7636/revisions/60/download
tags:
- Istio
- name: istio-workload
url: https://grafana.com/api/dashboards/7630/revisions/60/download
tags:
- Istio

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,9 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: istio-component-monitor
namespace: istio-system
namespace: {{ .Release.Namespace }}
labels:
release: metrics
{{ include "kubezero-lib.labels" . | indent 4 }}
spec:
jobLabel: istio
targetLabels: [app]
@ -14,5 +14,4 @@ spec:
- {key: istio, operator: In, values: [pilot]}
endpoints:
- port: http-monitoring
interval: 30s
{{- end }}

View File

@ -1,9 +1,9 @@
### TODO
- https://istio.io/latest/docs/ops/configuration/security/harden-docker-images/
#!/bin/bash
set -ex
### TODO
# - https://istio.io/latest/docs/ops/configuration/security/harden-docker-images/
export ISTIO_VERSION=1.9.3
rm -rf istio
@ -35,3 +35,6 @@ sed -i -e 's/name: istio-ingress/name: istio-private-ingress/' ../kubezero-istio
# Get matching istioctl
[ -x istioctl ] && [ "$(./istioctl version --remote=false)" == $ISTIO_VERSION ] || { curl -sL https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istioctl-${ISTIO_VERSION}-linux-amd64.tar.gz | tar xz; chmod +x istioctl; }
# Fetch dashboards from Grafana.com and update ZDT CM
../kubezero-metrics/sync_grafana_dashboards.py dashboards.yaml templates/grafana-dashboards.yaml