From deeb35bbb6d9a32ce3a5fbd6a738ceed96567171 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Sun, 31 Dec 2023 17:34:11 +0100 Subject: [PATCH] test monitoring --- apps/media/jellyfin.servicemonitor.yaml | 2 ++ apps/monitoring/prometheus.yaml | 46 ++----------------------- infrastructure/gitea/gitea.values.yaml | 4 +++ 3 files changed, 8 insertions(+), 44 deletions(-) diff --git a/apps/media/jellyfin.servicemonitor.yaml b/apps/media/jellyfin.servicemonitor.yaml index 28ecade..b65a255 100644 --- a/apps/media/jellyfin.servicemonitor.yaml +++ b/apps/media/jellyfin.servicemonitor.yaml @@ -2,6 +2,8 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: jellyfin + labels: + metrics: prometheus spec: selector: matchLabels: diff --git a/apps/monitoring/prometheus.yaml b/apps/monitoring/prometheus.yaml index e8abfeb..e6d4bf2 100644 --- a/apps/monitoring/prometheus.yaml +++ b/apps/monitoring/prometheus.yaml @@ -1,52 +1,10 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: prometheus ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: prometheus -rules: -- apiGroups: [""] - resources: - - nodes - - nodes/metrics - - services - - endpoints - - pods - verbs: ["get", "list", "watch"] -- apiGroups: [""] - resources: - - configmaps - verbs: ["get"] -- apiGroups: - - networking.k8s.io - resources: - - ingresses - verbs: ["get", "list", "watch"] -- nonResourceURLs: ["/metrics"] - verbs: ["get"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: prometheus -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: prometheus -subjects: -- kind: ServiceAccount - name: prometheus - # namespace: default ---- apiVersion: monitoring.coreos.com/v1 kind: Prometheus metadata: name: prometheus spec: - serviceAccountName: prometheus + matchLabels: + metrics: prometheus resources: requests: memory: 400Mi diff --git a/infrastructure/gitea/gitea.values.yaml b/infrastructure/gitea/gitea.values.yaml index f7613bb..471fde5 100644 --- a/infrastructure/gitea/gitea.values.yaml +++ b/infrastructure/gitea/gitea.values.yaml @@ -105,6 +105,10 @@ gitea: enabled: true serviceMonitor: enabled: true + # add labels to the metrics + # + labels: + metrics: prometheus ## @param gitea.config Configuration for the Gitea server,ref: [config-cheat-sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) config: