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.
|
Front end for Git, with integrated Container Registry and CI/CD capabilities.
|
||||||
This repository only contains configuration used for Kubernetes.
|
This repository only contains configuration used for Kubernetes.
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ data:
|
|||||||
GITEA__server__DISABLE_SSH: "true"
|
GITEA__server__DISABLE_SSH: "true"
|
||||||
GITEA__security__INSTALL_LOCK: "true"
|
GITEA__security__INSTALL_LOCK: "true"
|
||||||
GITEA__service__DISABLE_REGISTRATION: "true"
|
GITEA__service__DISABLE_REGISTRATION: "true"
|
||||||
|
GITEA__metrics__ENABLED: "true"
|
||||||
#app.ini: |
|
#app.ini: |
|
||||||
# APP_NAME = K8s implementation
|
# APP_NAME = K8s implementation
|
||||||
# RUN_MODE = prod
|
# RUN_MODE = prod
|
||||||
|
@ -1,23 +1,29 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
kind: Ingress
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: gitea-ingress
|
name: replace-regex
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
annotations:
|
|
||||||
kubernetes.io/ingress.class: "traefik"
|
|
||||||
spec:
|
spec:
|
||||||
tls:
|
replacePathRegex:
|
||||||
- secretName: gitea-beta-tls
|
regex: "^/metrics"
|
||||||
hosts:
|
replacement: "/"
|
||||||
- git.beta.halia.dev
|
|
||||||
rules:
|
---
|
||||||
- host: git.beta.halia.dev
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
http:
|
kind: IngressRoute
|
||||||
paths:
|
metadata:
|
||||||
- path: /
|
name: gitea-ingress
|
||||||
pathType: Prefix
|
namespace: gitea
|
||||||
backend:
|
annotations:
|
||||||
service:
|
kubernetes.io/ingress.class: "traefik"
|
||||||
name: gitea-svc
|
spec:
|
||||||
port:
|
entryPoints:
|
||||||
number: 80
|
- 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
|
- namespace.yaml
|
||||||
- database.yaml
|
- database.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
- servicemonitor.yaml
|
||||||
- ingress.yaml
|
- ingress.yaml
|
||||||
- configmap.yaml
|
- configmap.yaml
|
||||||
- admin-creator.yaml
|
- admin-creator.yaml
|
||||||
|
@ -3,6 +3,8 @@ kind: Service
|
|||||||
metadata:
|
metadata:
|
||||||
name: gitea-svc
|
name: gitea-svc
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: gitea
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- 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