From 87680a674b7d25a4103c6b8a861ae34743321d1f Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Mon, 19 Jun 2023 11:02:46 +0100 Subject: [PATCH] Add first version Signed-off-by: Michel Hollands --- charts/meta-monitoring/Chart.yaml | 35 ++++++++ charts/meta-monitoring/templates/grafana.yaml | 82 +++++++++++++++++++ charts/meta-monitoring/values.yaml | 57 +++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 charts/meta-monitoring/Chart.yaml create mode 100644 charts/meta-monitoring/templates/grafana.yaml create mode 100644 charts/meta-monitoring/values.yaml diff --git a/charts/meta-monitoring/Chart.yaml b/charts/meta-monitoring/Chart.yaml new file mode 100644 index 0000000..8c4ba98 --- /dev/null +++ b/charts/meta-monitoring/Chart.yaml @@ -0,0 +1,35 @@ +apiVersion: v2 +name: meta-monitoring +description: A Helm chart for meta monitoring Grafana Loki, Mimir and Tempo + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.0.1" + +dependencies: +- name: loki + repository: https://grafana.github.io/helm-charts + version: "5.8.0" +- name: grafana-agent + repository: https://grafana.github.io/helm-charts + version: "0.15.0" +- name: mimir-distributed + repository: https://grafana.github.io/helm-charts + version: "4.4.1" \ No newline at end of file diff --git a/charts/meta-monitoring/templates/grafana.yaml b/charts/meta-monitoring/templates/grafana.yaml new file mode 100644 index 0000000..435fc9e --- /dev/null +++ b/charts/meta-monitoring/templates/grafana.yaml @@ -0,0 +1,82 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: grafana-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: grafana + name: grafana +spec: + selector: + matchLabels: + app: grafana + template: + metadata: + labels: + app: grafana + spec: + securityContext: + fsGroup: 472 + supplementalGroups: + - 0 + containers: + - name: grafana + image: grafana/grafana:10.0.0 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + name: http-grafana + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /robots.txt + port: 3000 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 2 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + resources: + requests: + cpu: 250m + memory: 750Mi + volumeMounts: + - mountPath: /var/lib/grafana + name: grafana-pv + volumes: + - name: grafana-pv + persistentVolumeClaim: + claimName: grafana-pvc +--- +apiVersion: v1 +kind: Service +metadata: + name: grafana +spec: + ports: + - port: 3000 + protocol: TCP + targetPort: http-grafana + selector: + app: grafana + sessionAffinity: None + type: ClusterIP # Make this configurable \ No newline at end of file diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml new file mode 100644 index 0000000..4613946 --- /dev/null +++ b/charts/meta-monitoring/values.yaml @@ -0,0 +1,57 @@ +loki: + loki: + auth_enabled: false + commonConfig: + replication_factor: 1 + storage: + type: 'filesystem' + singleBinary: + replicas: 1 + extraArgs: ["-log.level=debug"] + monitoring: + dashboards: + enabled: false + rules: + enabled: false + serviceMonitor: + enabled: false + selfMonitoring: + enabled: false + grafanaAgent: + installOperator: false + lokiCanary: + enabled: false + test: + enabled: false + +grafana-agent: + agent: + configMap: + key: 'config.river' + content: | + discovery.kubernetes "pods" { + role = "pod" + namespaces { + names = ["loki"] // make configurable + } + } + loki.source.kubernetes "pods" { + targets = discovery.kubernetes.pods.targets + forward_to = [loki.write.local.receiver] + } + loki.write "local" { + endpoint { + url = "http://meta-loki.meta.svc.cluster.local:3100/loki/api/v1/push" // set namespace via config + } + } + prometheus.scrape "pods" { + targets = discovery.kubernetes.pods.targets + forward_to = [prometheus.remote_write.default.receiver] + } + prometheus.remote_write "default" { + endpoint { + url = "http://meta-mimir-nginx.meta.svc:80/api/v1/push" // set namespace via config + } + } + +# mimir-distributed: