I am having trouble with configuring grafana datasource with Helm Charts and Kubernetees. This is my release.yaml:
kind: Namespace
apiVersion: v1
metadata:
name: monitoring
annotations:
name: monitoring
labels:
name: monitoring
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-datasources
namespace: monitoring
data:
grafana.ini: |-
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: prometheus
namespace: monitoring
spec:
interval: 5m
chart:
spec:
chart: kube-prometheus
version: "8.0.7"
sourceRef:
kind: HelmRepository
name: bitnami
namespace: flux-system
interval: 1m
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: grafana
namespace: monitoring
spec:
interval: 5m
chart:
spec:
chart: grafana
version: "7.9.8"
sourceRef:
kind: HelmRepository
name: bitnami
namespace: flux-system
interval: 1m
values:
config:
useGrafanaIniFile: true
grafanaIniConfigMap: grafana-datasources
---
I see that grafana does have grafana.ini
file in /opt/bitnami/grafana/conf/
directory but when checking the datasources in grafana UI there is none. Does anyone know why this is the case, because I do not understand what I am doing wrong.