Skip to content

Commit

Permalink
Merge pull request #94 from akash4sh/main
Browse files Browse the repository at this point in the history
Rename grafana-dashboard chart with monitoring
  • Loading branch information
jebjohns authored Aug 19, 2023
2 parents efcd6d9 + 7624b25 commit dd6aa16
Show file tree
Hide file tree
Showing 25 changed files with 144 additions and 76 deletions.
24 changes: 0 additions & 24 deletions charts/grafana-dashboards/Chart.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions charts/grafana-dashboards/templates/NOTES.txt

This file was deleted.

2 changes: 1 addition & 1 deletion charts/k8ssandra-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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.1.2
version: 0.1.3

# 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
Expand Down
10 changes: 6 additions & 4 deletions charts/k8ssandra-cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: k8ssandra.io/v1alpha1
kind: K8ssandraCluster
metadata:
name: temporal
name: capten-cass
spec:
cassandra:
serverVersion: "4.0.1"
serverImage: k8ssandra/cass-management-api:4.0.1
serverImage: {{ .Values.image.serverImage }}
telemetry:
prometheus:
enabled: true
Expand All @@ -19,10 +19,12 @@ spec:
config:
jvmOptions:
heapSize: 512M
networking:
hostNetwork: {{ .Values.networking.hostNetwork }}
datacenters:
- metadata:
name: temporal
size: 1
name: capten-cass
size: {{ .Values.datacenters.size }}
mgmtAPIHeap: 256Mi
stargate:
size: 1
Expand Down
10 changes: 7 additions & 3 deletions charts/k8ssandra-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
replicaCount: 1

image:
repository: nginx
pullPolicy: IfNotPresent
serverImage: k8ssandra/cass-management-api:4.0.1
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

networking:
hostNetwork: false

datacenters:
size: 3

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions charts/monitoring/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
appVersion: 1.16.0
description: A Helm chart for Monitoring
name: monitoring
type: application
version: 0.1.7
dependencies:
- name: prometheus-msteams
condition: teams.enabled
version: 1.0.0
repository: https://kube-tarian.github.io/helmrepo-supporting-tools/
1 change: 1 addition & 0 deletions charts/monitoring/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "grafana-dashboards.name" -}}
{{- define "monitoring.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "grafana-dashboards.fullname" -}}
{{- define "monitoring.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "grafana-dashboards.chart" -}}
{{- define "monitoring.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "grafana-dashboards.labels" -}}
helm.sh/chart: {{ include "grafana-dashboards.chart" . }}
{{ include "grafana-dashboards.selectorLabels" . }}
{{- define "monitoring.labels" -}}
helm.sh/chart: {{ include "monitoring.chart" . }}
{{ include "monitoring.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "grafana-dashboards.selectorLabels" -}}
app.kubernetes.io/name: {{ include "grafana-dashboards.name" . }}
{{- define "monitoring.selectorLabels" -}}
app.kubernetes.io/name: {{ include "monitoring.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "grafana-dashboards.serviceAccountName" -}}
{{- define "monitoring.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "grafana-dashboards.fullname" .) .Values.serviceAccount.name }}
{{- default (include "monitoring.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-falco
name: {{ include "monitoring.fullname" . }}-falco
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Falco"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-k8ssandra-condensed
name: {{ include "monitoring.fullname" . }}-k8ssandra-condensed
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Cassandra"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-k8ssandra
name: {{ include "monitoring.fullname" . }}-k8ssandra
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Cassandra"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-k8ssandra-overview
name: {{ include "monitoring.fullname" . }}-k8ssandra-overview
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Cassandra"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-kubescape
name: {{ include "monitoring.fullname" . }}-kubescape
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Kubescape"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-kyverno
name: {{ include "monitoring.fullname" . }}-kyverno
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Kyverno"
Expand Down
36 changes: 36 additions & 0 deletions charts/monitoring/templates/openebs-cstor-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
release: prometheus
name: {{ include "monitoring.fullname" . }}-cstor
spec:
endpoints:
- path: /metrics
port: exporter
relabelings:
- action: keep
regex: volume_exporter_prometheus
sourceLabels:
- __meta_kubernetes_pod_label_monitoring
- action: replace
sourceLabels:
- __meta_kubernetes_pod_label_vsm
targetLabel: openebs_pv
- action: replace
sourceLabels:
- __meta_kubernetes_pod_label_openebs_io_persistent_volume
targetLabel: openebs_pv
- action: replace
sourceLabels:
- __meta_kubernetes_pod_label_openebs_io_persistent_volume_claim
targetLabel: openebs_pvc
- action: replace
sourceLabels:
- __meta_kubernetes_endpoints_label_openebs_io_cas_type
targetLabel: openebs_cas_type
namespaceSelector:
any: true
selector:
matchLabels:
openebs.io/cas-type: cstor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-alert.rules
name: {{ include "monitoring.fullname" . }}-alert.rules
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-slack-alertmanager
name: {{ include "monitoring.fullname" . }}-slack-alertmanager
labels:
alertmanagerConfig: slack
spec:
Expand All @@ -22,7 +22,7 @@ spec:
slackConfigs:
- sendResolved: true
apiURL:
name: {{ include "grafana-dashboards.fullname" . }}-slack-webhook
name: {{ include "monitoring.fullname" . }}-slack-webhook
key: webhookURL
channel: '{{ .Values.slack.channel }}'
iconURL: https://avatars3.githubusercontent.com/u/3380462
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-slack-webhook
name: {{ include "monitoring.fullname" . }}-slack-webhook
namespace: {{ .Release.Namespace }}
data:
webhookURL: {{ .Values.slack.webhook | b64enc }}
Expand Down
22 changes: 22 additions & 0 deletions charts/monitoring/templates/teams-alermanager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.teams.enabled }}
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
labels:
alertmanagerConfig: webhook
release: prometheus
name: {{ include "monitoring.fullname" . }}-webhook
spec:
receivers:
- name: webhook
webhookConfigs:
- url: '{{ .Values.teams.url }}'
route:
groupBy:
- job
groupInterval: 5m
groupWait: 30s
receiver: webhook
repeatInterval: 12h
{{- end }}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-temporal
name: {{ include "monitoring.fullname" . }}-temporal
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Temporal"
Expand Down
22 changes: 22 additions & 0 deletions charts/monitoring/templates/traefik-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/instance: traefik-traefik
app.kubernetes.io/name: traefik
release: prometheus
name: {{ include "monitoring.fullname" . }}-traefik
spec:
endpoints:
- honorLabels: true
interval: 30s
path: /metrics
port: metrics
jobLabel: traefik
namespaceSelector:
matchNames:
- traefik
selector:
matchLabels:
app.kubernetes.io/instance: traefik-traefik
app.kubernetes.io/name: traefik
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "grafana-dashboards.fullname" . }}-velero
name: {{ include "monitoring.fullname" . }}-velero
annotations:
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
grafana_folder: "Velero"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ slack:
webhook: "https://hooks.slack.com/services"
channel: "#capten-cluster-alert"

teams:
enabled: true
url: "http://prometheus-msteams:2000/alert"
container:
additionalArgs:
- -debug
- -teams-request-uri=alert
metrics:
serviceMonitor:
additionalLabels:
release: prometheus
enabled: true
scrapeInterval: 30s
connectors:
- alert: https://webhook.office.com/

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down

0 comments on commit dd6aa16

Please sign in to comment.