feat(traefik): Switch to ServiceMonitors for metric scraping

This commit is contained in:
Tanguy Herbron 2023-05-14 22:07:07 +02:00
parent 8b755928a2
commit 85159ee663
7 changed files with 62 additions and 32 deletions

View File

@ -2,7 +2,7 @@
| Name | Usage | Accessibility | Host | DB type | Additional data | Backup configuration | Loki integration | Prometheus integration | Secret management | Status | Standalone migration |
|-------------------------|--------------------------------------|------------------|-------------------------|------------|----------------------|----------------------|------------------|------------------------|------------------------|-----------------------------------|----------------------|
| Traefik | Reverse proxy and load balancer | Public & Private | Socrates & Pythagoras-b | - | - | - | Configured | Not configured | - | Completed<sup>5</sup> | Backbone |
| Traefik | Reverse proxy and load balancer | Public & Private | Socrates & Pythagoras-b | - | - | - | Configured | Configured | - | Completed<sup>5</sup> | Backbone |
| ArgoCD | Declarative GitOPS CD | Private | Pythagoras-b | - | - | - | Configured | Configured | - | Completed | Backbone |
| Vaultwarden | Password manager | Public | Pythagoras-b | PostgreSQL | - | 4AM K8s CronJob | Configured | Not available | Configured | Completed | Completed |
| Radarr | Movie collection manager | Private | Plato | PostgreSQL | - | - | Configured | Not configured | Not configured | Partial | Awaiting |

View File

@ -5,3 +5,4 @@ resources:
- pvc.yaml
- deployment.yaml
- service.yaml
- servicemonitor.yaml

View File

@ -1,23 +1,16 @@
---
# Source: traefik/templates/service.yaml
apiVersion: v1
kind: List
metadata:
name: traefik-external
items:
- apiVersion: v1
kind: Service
metadata:
name: traefik-external
labels:
app.kubernetes.io/name: traefik-external
helm.sh/chart: traefik-10.24.2
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: traefik
app.kubernetes.io/instance: traefik-external
annotations:
spec:
type: LoadBalancer
loadBalancerIP: 10.19.66.247
loadBalancerIP: 10.18.242.163
selector:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik
@ -34,3 +27,7 @@ items:
name: websecure
targetPort: "websecure"
protocol: TCP
- port: 9100
name: metrics
targetPort: "metrics"
protocol: TCP

View File

@ -0,0 +1,13 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: traefik-external
labels:
team: core
spec:
selector:
matchLabels:
app.kubernetes.io/name: traefik
endpoints:
- port: metrics
path: /metrics

View File

@ -5,3 +5,4 @@ resources:
- pvc.yaml
- deployment.yaml
- service.yaml
- servicemonitor.yaml

View File

@ -8,6 +8,7 @@ metadata:
app.kubernetes.io/instance: traefik-inter
spec:
type: LoadBalancer
loadBalancerIP: 10.10.0.26
selector:
app.kubernetes.io/name: traefik-inter
app.kubernetes.io/instance: traefik-inter
@ -20,3 +21,7 @@ spec:
name: websecure
targetPort: "websecure"
protocol: TCP
- port: 9100
name: metrics
targetPort: "metrics"
protocol: TCP

View File

@ -0,0 +1,13 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: traefik-inter
labels:
team: core
spec:
selector:
matchLabels:
app.kubernetes.io/name: traefik-inter
endpoints:
- port: metrics
path: /metrics