Skip to content

Commit

Permalink
Update Prometheus stack
Browse files Browse the repository at this point in the history
* Use Grafana from kube-prometheus-stack instead of own subchart
* Allow for using Prometheus from kube-prometheus-stack for full-stack monitoring
* Provide a Helm values file for full-stack monitoring
* This includes Kubernetes metrics exporters and dashboards
  • Loading branch information
SoerenHenning committed Nov 19, 2022
1 parent fffc83d commit 68fced5
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 85 deletions.
6 changes: 3 additions & 3 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ type: application

dependencies:
- name: grafana
version: 6.17.5
version: 6.17.*
repository: https://grafana.github.io/helm-charts
condition: grafana.enabled
- name: kube-prometheus-stack
version: 20.0.1
version: 41.7.*
repository: https://prometheus-community.github.io/helm-charts
condition: kube-prometheus-stack.enabled
- name: cp-helm-charts
version: 0.6.0
repository: https://soerenhenning.github.io/cp-helm-charts
condition: cp-helm-charts.enabled
- name: strimzi-kafka-operator
version: 0.29.0
version: 0.29.*
repository: https://strimzi.io/charts/
condition: strimzi.enabled

Expand Down
28 changes: 28 additions & 0 deletions helm/preconfigs/extended-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
###
# Prometheus Monitoring Stack (Prometheus Operator)
###
kube-prometheus-stack:
global:
rbac:
create: true # enable for full-stack monitoring

grafana:
defaultDashboardsEnabled: true

kubelet:
enabled: true

kubeDns:
enabled: true

kubeStateMetrics:
enabled: true

nodeExporter:
enabled: true

prometheus:
enabled: true # Use built-in Prometheus

prometheus:
enabled: false # Use built-in Prometheus
2 changes: 1 addition & 1 deletion helm/templates/grafana/dashboard-config-map.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.grafana.enabled -}}
{{- if (index .Values "kube-prometheus-stack" "grafana" "enabled") -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
31 changes: 0 additions & 31 deletions helm/templates/grafana/datasource-config-map.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions helm/templates/grafana/osp-dashboard-config-map.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if .Values.grafana.enabled -}}
{{- if (index .Values "kube-prometheus-stack" "grafana" "enabled") -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "theodolite.fullname" . }}-grafana-scalability-osp
labels:
grafana_dashboard: "2"
grafana_dashboard: "1"
data:
osp-dashboard.json: |-
{{`{
Expand Down
96 changes: 48 additions & 48 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,8 @@ kafkaClient:
# Grafana
###
grafana:
enabled: true
nodeSelector: {}
image:
repository: grafana/grafana
tag: 6.7.3
pullPolicy: IfNotPresent
# Administrator credentials when not using an existing secret (see below)
adminUser: admin
adminPassword: admin
grafana.ini:
#org_name: Theodolite
auth.anonymous:
# enable anonymous access
enabled: true
org_role: Admin # Role for unauthenticated users, other valid values are `Viewer`, `Editor` and `Admin`
users:
default_theme: light
#dashboards: # the following doesn't work but is planed
# Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
#default_home_dashboard_path: "/tmp/dashboards/k8s-dashboard.json"
## 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:
image:
repository: "kiwigrid/k8s-sidecar"
tag: "0.1.99"
imagePullPolicy: IfNotPresent
dashboards:
enabled: true
provider:
# allow updating provisioned dashboards from the UI
allowUiUpdates: true
datasources:
enabled: true
service:
nodePort: 31199
type: NodePort
rbac:
pspEnabled: false
namespaced: true
enabled: false



###
Expand Down Expand Up @@ -222,16 +184,45 @@ strimzi:
kube-prometheus-stack:
global:
rbac:
create: false

commonLabels:
appScope: titan-ccp
create: false # enable for full-stack monitoring

alertmanager:
enabled: false

grafana:
enabled: false
enabled: true
nodeSelector: {}
defaultDashboardsEnabled: false
# Administrator credentials when not using an existing secret (see below)
adminUser: admin
adminPassword: admin
grafana.ini:
#org_name: Theodolite
auth.anonymous:
# enable anonymous access
enabled: true
org_role: Admin # Role for unauthenticated users, other valid values are `Viewer`, `Editor` and `Admin`
users:
default_theme: light
#dashboards: # the following doesn't work but is planed
# Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
#default_home_dashboard_path: "/tmp/dashboards/k8s-dashboard.json"
## 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
provider:
# allow updating provisioned dashboards from the UI
allowUiUpdates: true
datasources:
enabled: true
url: http://prometheus-operated:9090/
service:
nodePort: 31199
type: NodePort
rbac:
namespaced: true

kubeApiServer:
enabled: false
Expand Down Expand Up @@ -276,13 +267,22 @@ kube-prometheus-stack:
serviceAccount:
create: true

# We use our own Prometheus
prometheus:
enabled: false
enabled: false # Default is using our own Prometheus
prometheusSpec:
serviceMonitorSelectorNilUsesHelmValues: false # Select all service monitors
podMonitorSelectorNilUsesHelmValues: false # Select all pod monitors
probeSelectorNilUsesHelmValues: false # Select all pod monitors
ruleSelectorNilUsesHelmValues: false # Select all pod monitors
resources:
requests:
memory: 400Mi
scrapeInterval: 15s
enableAdminAPI: true


###
# Prometheus
# Theodolite's custom Prometheus
###
prometheus:
enabled: true
Expand Down

0 comments on commit 68fced5

Please sign in to comment.