feat: Add Istio Grafana dashboards, enable metrics

This commit is contained in:
Stefan Reimer 2021-04-25 11:58:17 +02:00
parent a78ad7a7f9
commit a3d47cdb12
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 name: kubezero-istio-ingress
description: KubeZero Umbrella Chart for Istio based Ingress description: KubeZero Umbrella Chart for Istio based Ingress
type: application type: application
version: 0.5.5 version: 0.5.6
appVersion: 1.9.3 appVersion: 1.9.3
home: https://kubezero.com home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png 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 kind: PodMonitor
metadata: metadata:
name: envoy-stats-monitor name: envoy-stats-monitor
namespace: istio-ingress namespace: {{ .Release.Namespace }}
labels: labels:
release: metrics {{ include "kubezero-lib.labels" . | indent 4 }}
spec: spec:
selector: selector:
matchExpressions: matchExpressions:
@ -13,7 +13,6 @@ spec:
jobLabel: envoy-stats jobLabel: envoy-stats
podMetricsEndpoints: podMetricsEndpoints:
- path: /stats/prometheus - path: /stats/prometheus
interval: 30s
relabelings: relabelings:
- action: keep - action: keep
sourceLabels: [__meta_kubernetes_pod_container_name] 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 istioctl
istio-?.?.? istio-?.?.?

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero-istio name: kubezero-istio
description: KubeZero Umbrella Chart for Istio description: KubeZero Umbrella Chart for Istio
type: application type: application
version: 0.5.5 version: 0.5.6
appVersion: 1.9.3 appVersion: 1.9.3
home: https://kubezero.com home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png 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 kind: ServiceMonitor
metadata: metadata:
name: istio-component-monitor name: istio-component-monitor
namespace: istio-system namespace: {{ .Release.Namespace }}
labels: labels:
release: metrics {{ include "kubezero-lib.labels" . | indent 4 }}
spec: spec:
jobLabel: istio jobLabel: istio
targetLabels: [app] targetLabels: [app]
@ -14,5 +14,4 @@ spec:
- {key: istio, operator: In, values: [pilot]} - {key: istio, operator: In, values: [pilot]}
endpoints: endpoints:
- port: http-monitoring - port: http-monitoring
interval: 30s
{{- end }} {{- end }}

View File

@ -1,9 +1,9 @@
### TODO
- https://istio.io/latest/docs/ops/configuration/security/harden-docker-images/
#!/bin/bash #!/bin/bash
set -ex set -ex
### TODO
# - https://istio.io/latest/docs/ops/configuration/security/harden-docker-images/
export ISTIO_VERSION=1.9.3 export ISTIO_VERSION=1.9.3
rm -rf istio rm -rf istio
@ -35,3 +35,6 @@ sed -i -e 's/name: istio-ingress/name: istio-private-ingress/' ../kubezero-istio
# Get matching istioctl # 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; } [ -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