diff --git a/fail2ban-exporter/deployment.yaml b/fail2ban-exporter/deployment.yaml index 1709bf6..787f9ea 100644 --- a/fail2ban-exporter/deployment.yaml +++ b/fail2ban-exporter/deployment.yaml @@ -36,6 +36,10 @@ spec: - env: - name: GEOIP_LISTEN_ADDRESS value: :8080 + - name: GEOIP_EXPORTER_ADDRESS + value: :9191 + - name: GEOIP_ENABLE_EXPORTER + value: true - name: GEOIP_DATA_URL value: https://data.neuber.io/data.csv image: git.ar21.de/yolokube/country-geo-locations:latest @@ -45,6 +49,9 @@ spec: - containerPort: 8080 name: http protocol: TCP + - containerPort: 9191 + name: http + protocol: TCP readinessProbe: httpGet: httpHeaders: diff --git a/fail2ban-exporter/service.yaml b/fail2ban-exporter/service.yaml index b1447f5..85b4dbb 100644 --- a/fail2ban-exporter/service.yaml +++ b/fail2ban-exporter/service.yaml @@ -19,6 +19,25 @@ spec: --- apiVersion: v1 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: labels: app: fail2ban-prometheus-exporter diff --git a/fail2ban-exporter/servicemonitor.yaml b/fail2ban-exporter/servicemonitor.yaml index b275fa8..5ca65ca 100644 --- a/fail2ban-exporter/servicemonitor.yaml +++ b/fail2ban-exporter/servicemonitor.yaml @@ -26,3 +26,31 @@ spec: matchLabels: app.kubernetes.io/instance: fail2ban-prometheus 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