OneLab Kubernetes GitOps (Argo CD)
- Helm charts: onelab app + observability (Loki/Promtail/Grafana) - Values under gitops/values/ with public-safe placeholders - Argo CD Application (spec.sources, 2.6+) Made-with: Cursor
This commit is contained in:
12
gitops/observability/Chart.lock
Normal file
12
gitops/observability/Chart.lock
Normal file
@@ -0,0 +1,12 @@
|
||||
dependencies:
|
||||
- name: loki
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 6.55.0
|
||||
- name: promtail
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 6.17.1
|
||||
- name: grafana
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 10.5.15
|
||||
digest: sha256:5b34192a8db9d940587777fbc62a13503c21217da814308654ce73fca2ed5d56
|
||||
generated: "2026-03-20T11:06:47.9376325+01:00"
|
||||
16
gitops/observability/Chart.yaml
Normal file
16
gitops/observability/Chart.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v2
|
||||
name: onelab-observability
|
||||
description: Loki + Promtail + Grafana for OneLab (same Argo Application as app chart via multi-source).
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0"
|
||||
dependencies:
|
||||
- name: loki
|
||||
version: 6.55.0
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
- name: promtail
|
||||
version: 6.17.1
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
- name: grafana
|
||||
version: 10.5.15
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
BIN
gitops/observability/charts/grafana-10.5.15.tgz
Normal file
BIN
gitops/observability/charts/grafana-10.5.15.tgz
Normal file
Binary file not shown.
BIN
gitops/observability/charts/loki-6.55.0.tgz
Normal file
BIN
gitops/observability/charts/loki-6.55.0.tgz
Normal file
Binary file not shown.
BIN
gitops/observability/charts/promtail-6.17.1.tgz
Normal file
BIN
gitops/observability/charts/promtail-6.17.1.tgz
Normal file
Binary file not shown.
205
gitops/observability/dashboards/onelab-logs.json
Normal file
205
gitops/observability/dashboards/onelab-logs.json
Normal file
@@ -0,0 +1,205 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {"type": "grafana", "uid": "-- Grafana --"},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": null,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {"mode": "thresholds"},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [{"color": "blue", "value": null}]
|
||||
},
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {"h": 5, "w": 8, "x": 0, "y": 0},
|
||||
"id": 1,
|
||||
"options": {
|
||||
"colorMode": "value",
|
||||
"graphMode": "none",
|
||||
"justifyMode": "auto",
|
||||
"orientation": "auto",
|
||||
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
|
||||
"textMode": "auto"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"editorMode": "code",
|
||||
"expr": "sum(count_over_time({namespace=\"onelab\", component=~\"$component\"} |~ \"$filter\" [$__range]))",
|
||||
"queryType": "instant",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Total lines (namespace onelab, matches line filter)",
|
||||
"type": "stat"
|
||||
},
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {"mode": "thresholds"},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{"color": "green", "value": null},
|
||||
{"color": "orange", "value": 1}
|
||||
]
|
||||
},
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {"h": 5, "w": 8, "x": 8, "y": 0},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"colorMode": "value",
|
||||
"graphMode": "none",
|
||||
"justifyMode": "auto",
|
||||
"orientation": "auto",
|
||||
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
|
||||
"textMode": "auto"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"editorMode": "code",
|
||||
"expr": "sum(count_over_time({namespace=\"onelab\", component=~\"$component\"} |~ \"$filter\" |~ \"(?i)(\\\\[ERROR\\\\]|\\\\berror\\\\b|\\\\sERROR\\\\s)\" [$__range]))",
|
||||
"queryType": "instant",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "~ Error-like lines (heuristic)",
|
||||
"type": "stat"
|
||||
},
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {"mode": "thresholds"},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{"color": "green", "value": null},
|
||||
{"color": "yellow", "value": 1}
|
||||
]
|
||||
},
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {"h": 5, "w": 8, "x": 16, "y": 0},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"colorMode": "value",
|
||||
"graphMode": "none",
|
||||
"justifyMode": "auto",
|
||||
"orientation": "auto",
|
||||
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
|
||||
"textMode": "auto"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"editorMode": "code",
|
||||
"expr": "sum(count_over_time({namespace=\"onelab\", component=~\"$component\"} |~ \"$filter\" |~ \"(?i)(\\\\[WARN\\\\]|\\\\bwarn(ing)?\\\\b|\\\\sWARN\\\\s)\" [$__range]))",
|
||||
"queryType": "instant",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "~ Warning-like lines (heuristic)",
|
||||
"type": "stat"
|
||||
},
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"gridPos": {"h": 16, "w": 24, "x": 0, "y": 5},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"dedupStrategy": "none",
|
||||
"enableLogDetails": true,
|
||||
"prettifyLogMessage": false,
|
||||
"showCommonLabels": false,
|
||||
"showLabels": true,
|
||||
"showTime": true,
|
||||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": true
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"editorMode": "code",
|
||||
"expr": "{namespace=\"onelab\", component=~\"$component\"} |~ \"$filter\"",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "OneLab logs — use Component + Line filter (regex)",
|
||||
"type": "logs"
|
||||
}
|
||||
],
|
||||
"refresh": "30s",
|
||||
"schemaVersion": 39,
|
||||
"tags": ["onelab", "loki"],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"allValue": ".*",
|
||||
"current": {"selected": true, "text": "All", "value": "$__all"},
|
||||
"datasource": {"type": "loki", "uid": "loki"},
|
||||
"definition": "label_values({namespace=\"onelab\"}, component)",
|
||||
"hide": 0,
|
||||
"includeAll": true,
|
||||
"label": "Component",
|
||||
"multi": true,
|
||||
"name": "component",
|
||||
"options": [],
|
||||
"query": "label_values({namespace=\"onelab\"}, component)",
|
||||
"refresh": 2,
|
||||
"regex": "",
|
||||
"sort": 1,
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
"current": {"selected": true, "text": ".*", "value": ".*"},
|
||||
"hide": 0,
|
||||
"label": "Line filter (regex)",
|
||||
"name": "filter",
|
||||
"options": [
|
||||
{"selected": true, "text": ".*", "value": ".*"}
|
||||
],
|
||||
"query": ".*",
|
||||
"type": "textbox"
|
||||
}
|
||||
]
|
||||
},
|
||||
"time": {"from": "now-1h", "to": "now"},
|
||||
"timepicker": {},
|
||||
"timezone": "browser",
|
||||
"title": "OneLab logs",
|
||||
"uid": "onelab-logs",
|
||||
"version": 1,
|
||||
"weekStart": ""
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{- if .Values.grafana.sidecar.dashboards.enabled }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ printf "%s-dashboard-onelab-logs" .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
grafana_dashboard: "1"
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
data:
|
||||
onelab-logs.json: |-
|
||||
{{ .Files.Get "dashboards/onelab-logs.json" | nindent 4 }}
|
||||
{{- end }}
|
||||
36
gitops/observability/templates/ingress-grafana-onelab.yaml
Normal file
36
gitops/observability/templates/ingress-grafana-onelab.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
{{- if .Values.grafanaOnelabIngress.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: grafana-onelab
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app.kubernetes.io/name: grafana-onelab
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: observability
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
cert-manager.io/cluster-issuer: {{ .Values.grafanaOnelabIngress.clusterIssuer | quote }}
|
||||
{{- with .Values.grafanaOnelabIngress.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.grafanaOnelabIngress.className | quote }}
|
||||
{{- if .Values.grafanaOnelabIngress.tls }}
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ .Values.grafanaOnelabIngress.host | quote }}
|
||||
secretName: {{ .Values.grafanaOnelabIngress.tlsSecretName | quote }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: {{ .Values.grafanaOnelabIngress.host | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ printf "%s-grafana" .Release.Name }}
|
||||
port:
|
||||
number: {{ .Values.grafanaOnelabIngress.servicePort }}
|
||||
{{- end }}
|
||||
3
gitops/observability/values.yaml
Normal file
3
gitops/observability/values.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Operator-facing overrides live in gitops/values/observability.yaml (see gitops/argocd/application.yaml helm.valueFiles).
|
||||
# This file is kept minimal on purpose.
|
||||
{}
|
||||
Reference in New Issue
Block a user