Add exporter to gitea

This commit is contained in:
dvirlabs 2025-05-21 10:00:54 +03:00
parent 2c84d02a8e
commit 2d68590860
8 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: gitea-exporter
namespace: argocd
spec:
project: exporters
source:
repoURL: https://git.dvirlabs.com/dvirlabs/dev-tools.git
targetRevision: master
path: charts/gitea-exporter
helm:
valueFiles:
- ../../manifests/exporters/gitea-exporter/values.yaml
destination:
server: https://kubernetes.default.svc
namespace: dev-tools
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -0,0 +1,5 @@
apiVersion: v2
name: gitea-exporter
description: A Helm chart for deploying the Gitea Prometheus exporter
version: 0.1.0
appVersion: latest

View File

@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea-exporter
labels:
app: gitea-exporter
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: gitea-exporter
template:
metadata:
labels:
app: gitea-exporter
spec:
containers:
- name: exporter
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.port }}
name: metrics
env:
- name: GITEA_BASE_URL
value: {{ .Values.gitea.baseUrl | quote }}
- name: GITEA_TOKEN
valueFrom:
secretKeyRef:
name: gitea-exporter-secret
key: token

View File

@ -0,0 +1,15 @@
{{- if .Values.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: gitea-exporter
labels:
{{- toYaml .Values.monitoring.labels | nindent 4 }}
spec:
selector:
matchLabels:
app: gitea-exporter
podMetricsEndpoints:
- port: metrics
interval: 30s
{{- end }}

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: gitea-exporter-secret
type: Opaque
stringData:
token: {{ .Values.gitea.token | quote }}

View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: gitea-exporter
labels:
app: gitea-exporter
spec:
ports:
- name: metrics
port: {{ .Values.service.port }}
targetPort: metrics
selector:
app: gitea-exporter

View File

@ -0,0 +1,20 @@
replicaCount: 1
image:
repository: quay.io/mook/gitea-exporter
tag: latest
pullPolicy: IfNotPresent
gitea:
baseUrl: "https://git.dvirlabs.com"
token: "REPLACE_ME"
service:
port: 9421
monitoring:
enabled: true
labels:
release: prometheus
resources: {}

View File

@ -0,0 +1,3 @@
gitea:
baseUrl: "https://git.dvirlabs.com"
token: "your-gitea-api-token-here"