Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring Enhancements - Dashboards Autoprovisioning [K8s] #760

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ readinessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 120
timeoutSeconds: 5
failureThreshold: 5

livenessProbe:
httpGet:
Expand Down Expand Up @@ -695,28 +698,28 @@ alerting: {}
## Configure notifiers
## ref: http://docs.grafana.org/administration/provisioning/#alert-notification-channels
##
notifiers:
notifiers.yaml:
apiVersion: 1

notifiers:
- name: Telegram-notification
type: telegram
uid: notifier1
#notifiers:
# notifiers.yaml:
#apiVersion: 1

# notifiers:
# - name: Telegram-notification
#type: telegram
# uid: notifier1
# either
org_id: 1
# org_id: 1
# or
is_default: false
send_reminder: true
frequency: 1h
disable_resolve_message: false
#is_default: false
#send_reminder: true
#frequency: 1h
#disable_resolve_message: false
# See `Supported Settings` section for settings supported for each
# alert notification type.
settings:
chatid: $TELEGRAM_CHAT_ID
#settings:
#chatid: $TELEGRAM_CHAT_ID
# Secure settings that will be encrypted in the database (supported since Grafana v7.2). See `Supported Settings` section for secure settings supported for each notifier.
secure_settings:
bottoken: $TELEGRAM_BOT_TOKEN
#secure_settings:
#bottoken: $TELEGRAM_BOT_TOKEN


# notifiers.yaml:
Expand Down Expand Up @@ -874,6 +877,9 @@ smtp:
## Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders
## Requires at least Grafana 5 to work and can't be used together with parameters dashboardProviders, datasources and dashboards
sidecar:
dashboards:
enabled: true
label: grafana_dashboard
image:
# -- The Docker registry
registry: quay.io
Expand All @@ -882,12 +888,6 @@ sidecar:
sha: ""
imagePullPolicy: IfNotPresent
resources: {}
# limits:
# cpu: 100m
# memory: 100Mi
# requests:
# cpu: 50m
# memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down Expand Up @@ -1357,4 +1357,4 @@ extraObjects: []
#
# Alternatively, if you wish to allow secret values to be exposed in the rendered grafana.ini configmap,
# you can disable this check by setting assertNoLeakedSecrets to false.
assertNoLeakedSecrets: true
assertNoLeakedSecrets: true
55 changes: 45 additions & 10 deletions K8s-deployment/K8s-cluster/addons/mon-stack/install.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,58 @@
#!/bin/bash

# Create the namespace
kubectl create namespace mon-stack
# certificate fro certmanager
# kubectl create secret tls grafana-tls-secret -n mon-stack --key secrets/pki/privkey.pem --cert secrets/pki/fullchain.pem
# Depreacting sealed secrets
# kubectl apply -f sealed-secrets/
kubectl create secret generic grafana-env-secret --from-env-file=secrets/grafana-env-secret -n mon-stack
kubectl create secret generic grafana-credentials --from-file=./secrets/admin-user --from-file=./secrets/admin-password -n mon-stack
kubectl create secret generic blackbox-targets --from-file=./secrets/blackbox-targets.yaml -n mon-stack

# Create secrets
kubectl create secret generic grafana-env-secret --from-env-file=secrets/grafana-env-secret -n mon-stack
kubectl create secret generic grafana-credentials --from-file=./secrets/admin-user --from-file=./secrets/admin-password -n mon-stack
kubectl create secret generic blackbox-targets --from-file=./secrets/blackbox-targets.yaml -n mon-stack

# Create the ConfigMap for Grafana dashboards from the dashboards directory
kubectl create configmap grafana-dashboards-backend \
--from-file=./grafana/dashboards/Backend/ \
-n mon-stack

kubectl create configmap grafana-dashboards-general \
--from-file=./grafana/dashboards/General/ \
-n mon-stack

kubectl create configmap grafana-dashboards-gateway \
--from-file=./grafana/dashboards/Gateway/ \
-n mon-stack

kubectl create configmap grafana-dashboards-kubernetes \
--from-file=./grafana/dashboards/Kubernetes/ \
-n mon-stack

kubectl create configmap grafana-dashboards-vertx \
--from-file=./grafana/dashboards/Vertx Applications/ \
-n mon-stack

kubectl label configmap grafana-dashboards-backend \
grafana_dashboard=true -n mon-stack

kubectl label configmap grafana-dashboards-general \
grafana_dashboard=true -n mon-stack

kubectl label configmap grafana-dashboards-gateway \
grafana_dashboard=true -n mon-stack

kubectl label configmap grafana-dashboards-kubernetes \
grafana_dashboard=true -n mon-stack

kubectl label configmap grafana-dashboards-vertx \
grafana_dashboard=true -n mon-stack

# Install Prometheus, Loki, Grafana, Promtail, Blackbox with Helm
helm repo update prometheus-community kube-state-metrics grafana

helm install --version=25.8.2 -n mon-stack prometheus -f prometheus/prometheus-values.yaml -f prometheus/resource-values.yaml prometheus-community/prometheus
sleep 20
helm install --version=5.42.0 -n mon-stack -f loki/loki-values.yaml -f loki/resource-values.yaml loki grafana/loki
helm install --version=5.42.0 -n mon-stack -f loki/loki-values.yaml -f loki/resource-values.yaml loki grafana/loki
sleep 20
helm install --version=7.2.5 -f grafana/grafana-values.yaml -f grafana/resource-values.yaml grafana -n mon-stack grafana/grafana
helm install --version=7.2.5 -f grafana/grafana-values.yaml -f grafana/resource-values.yaml grafana -n mon-stack grafana/grafana
sleep 20
helm install --version=6.15.5 -f promtail/promtail-values.yaml -f promtail/resource-values.yaml -n mon-stack promtail grafana/promtail
sleep 20
helm install --version=8.12.0 -f blackbox/blackbox-values.yaml -f blackbox/resource-values.yaml -n mon-stack blackbox prometheus-community/prometheus-blackbox-exporter