feat(metrics): Add metric scraping
Add ServiceMonitor resource to scrape /metrics endpoint. Said endpoint cannot be scrapped from outside of the cluster, as a special IngressRoute Middleware prevents the exposition of said endpoint.
This commit is contained in:
parent
5452633f37
commit
1830d126a5
@ -2,3 +2,4 @@
|
||||
|
||||
Front end for Git, with integrated Container Registry and CI/CD capabilities.
|
||||
This repository only contains configuration used for Kubernetes.
|
||||
|
||||
|
@ -9,6 +9,7 @@ data:
|
||||
GITEA__server__DISABLE_SSH: "true"
|
||||
GITEA__security__INSTALL_LOCK: "true"
|
||||
GITEA__service__DISABLE_REGISTRATION: "true"
|
||||
GITEA__metrics__ENABLED: "true"
|
||||
#app.ini: |
|
||||
# APP_NAME = K8s implementation
|
||||
# RUN_MODE = prod
|
||||
|
@ -1,23 +1,29 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: gitea-ingress
|
||||
namespace: gitea
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "traefik"
|
||||
name: replace-regex
|
||||
namespace: gitea
|
||||
spec:
|
||||
tls:
|
||||
- secretName: gitea-beta-tls
|
||||
hosts:
|
||||
- git.beta.halia.dev
|
||||
rules:
|
||||
- host: git.beta.halia.dev
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: gitea-svc
|
||||
port:
|
||||
number: 80
|
||||
replacePathRegex:
|
||||
regex: "^/metrics"
|
||||
replacement: "/"
|
||||
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: gitea-ingress
|
||||
namespace: gitea
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "traefik"
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`git.beta.halia.dev`) && PathPrefix(`/`)
|
||||
kind: Rule
|
||||
middlewares:
|
||||
- name: replace-regex
|
||||
services:
|
||||
- name: gitea-svc
|
||||
port: 80
|
||||
|
@ -5,6 +5,7 @@ resources:
|
||||
- namespace.yaml
|
||||
- database.yaml
|
||||
- service.yaml
|
||||
- servicemonitor.yaml
|
||||
- ingress.yaml
|
||||
- configmap.yaml
|
||||
- admin-creator.yaml
|
||||
|
@ -3,6 +3,8 @@ kind: Service
|
||||
metadata:
|
||||
name: gitea-svc
|
||||
namespace: gitea
|
||||
labels:
|
||||
app.kubernetes.io/name: gitea
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
|
14
manifests/servicemonitor.yaml
Normal file
14
manifests/servicemonitor.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: gitea
|
||||
namespace: gitea
|
||||
labels:
|
||||
team: core
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: gitea
|
||||
endpoints:
|
||||
- port: http
|
||||
path: /metrics
|
Loading…
Reference in New Issue
Block a user