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 | | 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 | | 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 | | 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 | | Radarr | Movie collection manager | Private | Plato | PostgreSQL | - | - | Configured | Not configured | Not configured | Partial | Awaiting |

View File

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

View File

@ -1,36 +1,33 @@
--- ---
# Source: traefik/templates/service.yaml # Source: traefik/templates/service.yaml
apiVersion: v1 apiVersion: v1
kind: List kind: Service
metadata: metadata:
name: traefik-external name: traefik-external
items: labels:
- apiVersion: v1 app.kubernetes.io/name: traefik-external
kind: Service app.kubernetes.io/instance: traefik-external
metadata: annotations:
name: traefik-external spec:
labels: type: LoadBalancer
app.kubernetes.io/name: traefik-external loadBalancerIP: 10.18.242.163
helm.sh/chart: traefik-10.24.2 selector:
app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik app.kubernetes.io/instance: traefik
annotations: ports:
spec: - port: 25565
type: LoadBalancer name: minecrafttcp
loadBalancerIP: 10.19.66.247 targetPort: "minecrafttcp"
selector: protocol: TCP
app.kubernetes.io/name: traefik - port: 80 # Change port here to accomodate for internal only services
app.kubernetes.io/instance: traefik name: web
ports: targetPort: "web"
- port: 25565 protocol: TCP
name: minecrafttcp - port: 443
targetPort: "minecrafttcp" name: websecure
protocol: TCP targetPort: "websecure"
- port: 80 # Change port here to accomodate for internal only services protocol: TCP
name: web - port: 9100
targetPort: "web" name: metrics
protocol: TCP targetPort: "metrics"
- port: 443 protocol: TCP
name: websecure
targetPort: "websecure"
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 - pvc.yaml
- deployment.yaml - deployment.yaml
- service.yaml - service.yaml
- servicemonitor.yaml

View File

@ -8,6 +8,7 @@ metadata:
app.kubernetes.io/instance: traefik-inter app.kubernetes.io/instance: traefik-inter
spec: spec:
type: LoadBalancer type: LoadBalancer
loadBalancerIP: 10.10.0.26
selector: selector:
app.kubernetes.io/name: traefik-inter app.kubernetes.io/name: traefik-inter
app.kubernetes.io/instance: traefik-inter app.kubernetes.io/instance: traefik-inter
@ -20,3 +21,7 @@ spec:
name: websecure name: websecure
targetPort: "websecure" targetPort: "websecure"
protocol: TCP 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