Merge pull request 'feat(fail2ban-exporter): add service monitor for geoip services' (#339) from tn-adjust-fail2ban-geoip-service into main
All checks were successful
ci/woodpecker/push/yamllint Pipeline was successful

Reviewed-on: #339
This commit is contained in:
Tom Neuber 2024-11-28 12:31:34 +01:00
commit a94664e2e9
3 changed files with 54 additions and 0 deletions

View file

@ -36,6 +36,10 @@ spec:
- env: - env:
- name: GEOIP_LISTEN_ADDRESS - name: GEOIP_LISTEN_ADDRESS
value: :8080 value: :8080
- name: GEOIP_EXPORTER_ADDRESS
value: :9191
- name: GEOIP_ENABLE_EXPORTER
value: true
- name: GEOIP_DATA_URL - name: GEOIP_DATA_URL
value: https://data.neuber.io/data.csv value: https://data.neuber.io/data.csv
image: git.ar21.de/yolokube/country-geo-locations:latest image: git.ar21.de/yolokube/country-geo-locations:latest
@ -45,6 +49,9 @@ spec:
- containerPort: 8080 - containerPort: 8080
name: http name: http
protocol: TCP protocol: TCP
- containerPort: 9191
name: http
protocol: TCP
readinessProbe: readinessProbe:
httpGet: httpGet:
httpHeaders: httpHeaders:

View file

@ -19,6 +19,25 @@ spec:
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata:
labels:
app: fail2ban-geoip
app.kubernetes.io/instance: fail2ban-prometheus
app.kubernetes.io/name: fail2ban-geoip
name: fail2ban-geoip
namespace: fail2ban-prometheus
spec:
ports:
- name: http-metrics
port: 9191
protocol: TCP
targetPort: 9191
selector:
app: fail2ban-geoip
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata: metadata:
labels: labels:
app: fail2ban-prometheus-exporter app: fail2ban-prometheus-exporter

View file

@ -26,3 +26,31 @@ spec:
matchLabels: matchLabels:
app.kubernetes.io/instance: fail2ban-prometheus app.kubernetes.io/instance: fail2ban-prometheus
app.kubernetes.io/name: fail2ban-prometheus-exporter app.kubernetes.io/name: fail2ban-prometheus-exporter
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app: fail2ban-geoip
app.kubernetes.io/instance: fail2ban-prometheus
app.kubernetes.io/name: fail2ban-geoip
name: fail2ban-geoip-servicemonitor
namespace: fail2ban-prometheus
spec:
attachMetadata:
node: false
endpoints:
- interval: 10s
path: /metrics
port: http-metrics
relabelings:
- action: replace
sourceLabels:
- __meta_kubernetes_endpoint_node_name
targetLabel: node
scheme: http
jobLabel: jobLabel
selector:
matchLabels:
app.kubernetes.io/instance: fail2ban-prometheus
app.kubernetes.io/name: fail2ban-geoip