-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding monitoring for main-nats and leaf nats, refactored repo (#…
…18) Signed-off-by: Armin Schlegel <armin.schlegel@gmx.de>
- Loading branch information
Showing
28 changed files
with
951 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
all | ||
|
||
rule 'MD013', :line_length => 120 | ||
exclude_rule "MD033" | ||
exclude_rule "MD034" | ||
exclude_rule "MD041" | ||
exclude_rule "MD010" | ||
rule "MD013", line_length: 120, code_blocks: false, tables: false, stern: true | ||
rule "MD029", style: "ordered" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v2 | ||
appVersion: 0.1.0 | ||
description: A Helm chart for main-nats-monitoring components | ||
maintainers: | ||
- email: armin.schlegel@gmx.de | ||
name: siredmar | ||
name: main-nats-monitoring | ||
sources: | ||
- https://github.com/prometheus/node_exporter/ | ||
type: application | ||
version: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Main nats monitoring | ||
|
||
This helm chart deploys everything that is needed to monitor the main nats cluster. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "main-nats-monitoring.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
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 "main-nats-monitoring.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "main-nats-monitoring.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "main-nats-monitoring.labels" -}} | ||
{{ include "main-nats-monitoring.selectorLabels" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: operator | ||
helm.sh/chart: {{ include "main-nats-monitoring.chart" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
{{- if .Values.customLabels }} | ||
{{ toYaml .Values.customLabels }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "main-nats-monitoring.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "main-nats-monitoring.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "main-nats-monitoring.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "main-nats-monitoring.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
12 changes: 5 additions & 7 deletions
12
...rts/grafana-agent/nats_grafana_agent.yaml → ...itoring/templates/nats_grafana_agent.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
apiVersion: monitoring.grafana.com/v1alpha1 | ||
kind: GrafanaAgent | ||
metadata: | ||
name: grafana-agent | ||
namespace: monitoring | ||
labels: | ||
app.kubernetes.io/instance: grafana-agent | ||
name: {{ include "main-nats-monitoring.fullname" . }} | ||
namespace: {{ .Values.namespace | default .Release.Namespace }} | ||
spec: | ||
image: grafana/agent:v0.28.0 | ||
logLevel: info | ||
serviceAccountName: grafana-agent | ||
serviceAccountName: {{ include "main-nats-monitoring.name" . }} | ||
metrics: | ||
instanceSelector: | ||
matchLabels: | ||
app.kubernetes.io/component: meta-monitoring | ||
app.kubernetes.io/instance: grafana-mimir | ||
app.kubernetes.io/instance: {{ include "main-nats-monitoring.name" . }} | ||
app.kubernetes.io/name: mimir | ||
externalLabels: | ||
cluster: cloud | ||
logs: | ||
instanceSelector: | ||
matchLabels: | ||
agent: grafana-agent-logs | ||
agent: grafana-agent-logs |
21 changes: 21 additions & 0 deletions
21
charts/main-nats-monitoring/templates/nats_metric_instance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: monitoring.grafana.com/v1alpha1 | ||
kind: MetricsInstance | ||
metadata: | ||
name: main-nats | ||
namespace: {{ .Values.namespace | default .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/component: meta-monitoring | ||
app.kubernetes.io/instance: {{ include "main-nats-monitoring.name" . }} | ||
app.kubernetes.io/name: mimir | ||
spec: | ||
remoteWrite: | ||
- url: http://grafana-mimir-nginx.monitoring.svc:80/api/v1/push | ||
basicAuth: | ||
username: | ||
name: main-nats-monitoring-grafana-creds | ||
key: username | ||
password: | ||
name: main-nats-monitoring-grafana-creds | ||
key: password | ||
serviceMonitorNamespaceSelector: {} | ||
serviceMonitorSelector: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: main-nats-monitoring-grafana-creds | ||
namespace: {{ .Values.namespace | default .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/instance: {{ include "main-nats-monitoring.name" . }} | ||
data: | ||
username: {{ .Values.mimir.user | b64enc }} | ||
password: {{ .Values.mimir.password | b64enc }} | ||
type: Opaque |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
mimir: | ||
username: user | ||
password: password | ||
|
||
agent: | ||
image: grafana/agent:v0.28.0 |
Oops, something went wrong.