diff --git a/argocd-apps/gitea-exporter.yaml b/argocd-apps/gitea-exporter.yaml new file mode 100644 index 0000000..7296358 --- /dev/null +++ b/argocd-apps/gitea-exporter.yaml @@ -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 \ No newline at end of file diff --git a/charts/gitea-exporter/Chart.yaml b/charts/gitea-exporter/Chart.yaml new file mode 100644 index 0000000..426c2d3 --- /dev/null +++ b/charts/gitea-exporter/Chart.yaml @@ -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 \ No newline at end of file diff --git a/charts/gitea-exporter/templates/deployment.yaml b/charts/gitea-exporter/templates/deployment.yaml new file mode 100644 index 0000000..13e36d5 --- /dev/null +++ b/charts/gitea-exporter/templates/deployment.yaml @@ -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 \ No newline at end of file diff --git a/charts/gitea-exporter/templates/podmonitor.yaml b/charts/gitea-exporter/templates/podmonitor.yaml new file mode 100644 index 0000000..4e8ce84 --- /dev/null +++ b/charts/gitea-exporter/templates/podmonitor.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/gitea-exporter/templates/secret.yaml b/charts/gitea-exporter/templates/secret.yaml new file mode 100644 index 0000000..d8a92b0 --- /dev/null +++ b/charts/gitea-exporter/templates/secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: gitea-exporter-secret +type: Opaque +stringData: + token: {{ .Values.gitea.token | quote }} \ No newline at end of file diff --git a/charts/gitea-exporter/templates/service.yaml b/charts/gitea-exporter/templates/service.yaml new file mode 100644 index 0000000..3ddcafd --- /dev/null +++ b/charts/gitea-exporter/templates/service.yaml @@ -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 \ No newline at end of file diff --git a/charts/gitea-exporter/values.yaml b/charts/gitea-exporter/values.yaml new file mode 100644 index 0000000..56be1d8 --- /dev/null +++ b/charts/gitea-exporter/values.yaml @@ -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: {} \ No newline at end of file diff --git a/manifests/exporters/gitea-exporter/values.yaml b/manifests/exporters/gitea-exporter/values.yaml new file mode 100644 index 0000000..2ae9f26 --- /dev/null +++ b/manifests/exporters/gitea-exporter/values.yaml @@ -0,0 +1,3 @@ +gitea: + baseUrl: "https://git.dvirlabs.com" + token: "your-gitea-api-token-here" \ No newline at end of file