From 92296bf1aec4c1059260996073e9c31994dd4f54 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Fri, 3 Dec 2021 15:28:17 +0100 Subject: [PATCH] FEAT: replace bitnami prometheus/grafana chart with prometheus-community --- README.md | 3 +-- files/grafana-provisioning.yml | 21 ++++----------------- group_vars/all.yml | 31 ++++++++++++------------------- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 4af785e..a8582bb 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,5 @@ Install: * [NGINX Ingress Controller](https://kubernetes.github.io/ingress-nginx/) * [cert-manager](https://cert-manager.io/) * [metrics-server](https://github.com/bitnami/charts/tree/master/bitnami/metrics-server) -* [prometheus](https://github.com/bitnami/charts/tree/master/bitnami/kube-prometheus) and - [grafana](https://github.com/bitnami/charts/tree/master/bitnami/grafana) for ingress stats +* [prometheus and grafana](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) * [keel](https://keel.sh) diff --git a/files/grafana-provisioning.yml b/files/grafana-provisioning.yml index 74b5fc5..b4d9810 100644 --- a/files/grafana-provisioning.yml +++ b/files/grafana-provisioning.yml @@ -1,26 +1,13 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - name: grafana-datasource - namespace: metrics -stringData: - grafana-datasource.yaml: | - apiVersion: 1 - datasources: - - name: Prometheus - type: prometheus - access: server - url: http://prometheus-kube-prometheus-prometheus:9090 - --- apiVersion: v1 kind: ConfigMap metadata: - name: grafana-dashboard + name: grafana-nginx-dashbaord namespace: metrics + labels: + grafana_dashboard: "1" data: - grafana-dashboard.json: | + nginx.json: | { "__inputs": [ { diff --git a/group_vars/all.yml b/group_vars/all.yml index 6cc7acc..34a9c3c 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -1,5 +1,6 @@ --- helm_repos: + - { repo: prometheus-community, url: https://prometheus-community.github.io/helm-charts } - { repo: bitnami, url: https://charts.bitnami.com/bitnami } - { repo: ingress-nginx, url: https://kubernetes.github.io/ingress-nginx } - { repo: jetstack, url: https://charts.jetstack.io } @@ -17,27 +18,19 @@ helm_charts: kubelet-insecure-tls: true kubelet-preferred-address-types: InternalIP - - chart: bitnami/kube-prometheus - name: prometheus + - chart: prometheus-community/kube-prometheus-stack + name: monitoring namespace: metrics vals: prometheus: - persistence: - enabled: true - - - chart: bitnami/grafana - name: grafana - namespace: metrics - vals: - persistence: - enabled: false - dashboardsProvider: - enabled: true - datasources: - secretName: grafana-datasource - dashboardsConfigMaps: - - configMapName: grafana-dashboard - fileName: grafana-dashboard.json + prometheusSpec: + storageSpec: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 10Gi - chart: ingress-nginx/ingress-nginx name: ingress-nginx @@ -52,7 +45,7 @@ helm_charts: serviceMonitor: enabled: true additionalLabels: - app.kubernetes.io/instance: prometheus + release: monitoring # same as prometheus-community chart name - chart: jetstack/cert-manager name: cert-manager