Compare commits
59 commits
37ed089fc7
...
cd3b26f448
Author | SHA1 | Date | |
---|---|---|---|
cd3b26f448 | |||
5ac0b378ef | |||
a6cf3c2e55 | |||
a3cd97f907 | |||
d953ef6aa3 | |||
c98106baa0 | |||
7465cf856f | |||
8757be0399 | |||
646d251163 | |||
4179ebb298 | |||
d5ebc335ff | |||
e52ef858c9 | |||
63d4b60959 | |||
78ded34c5b | |||
cf472d8a0b | |||
cc2e7f74c8 | |||
0a2f399ce1 | |||
a624181d60 | |||
c5f4690398 | |||
b8fabf5a34 | |||
f5ab42e21d | |||
1ce281a633 | |||
3972f31025 | |||
6ac6410d6a | |||
af96fce872 | |||
3973d31fb2 | |||
7532fa1882 | |||
3c2b9b9c1b | |||
b30157d9bd | |||
efc99d4972 | |||
93e6017176 | |||
f461b675c1 | |||
eee1e280de | |||
834ba80b25 | |||
eb631e6bd8 | |||
0b4e9e48eb | |||
4ed8f1abe9 | |||
107139ff7e | |||
6b43be1176 | |||
bb9e22ffe7 | |||
9aae18ec30 | |||
e84b8529c5 | |||
43dfcc4b8f | |||
e9722b8452 | |||
3635d9de70 | |||
101a6d29ab | |||
c8cd3c003b | |||
8b5c1ff021 | |||
6477efa1aa | |||
bdb79cda63 | |||
384d7ddff3 | |||
9723669778 | |||
68ef9eb380 | |||
a992c3265e | |||
630971c6c0 | |||
2fc99a5bdc | |||
7d0382fcc4 | |||
f88729b372 | |||
2dc2c7e548 |
10 changed files with 252 additions and 2 deletions
|
@ -72,3 +72,24 @@ spec:
|
|||
automated:
|
||||
selfHeal: false
|
||||
prune: false
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: fail2ban-prometheus
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://git.ar21.de/yolokube/core-deployments.git
|
||||
targetRevision: HEAD
|
||||
path: fail2ban-exporter
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: fail2ban-prometheus
|
||||
syncPolicy:
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
automated:
|
||||
selfHeal: false
|
||||
prune: true
|
||||
|
|
|
@ -5,5 +5,5 @@ kind: Kustomization
|
|||
images:
|
||||
- name: git.ar21.de/yolokube/dashboard
|
||||
newName: git.ar21.de/yolokube/dashboard
|
||||
newTag: "171"
|
||||
newTag: "189"
|
||||
namespace: dashboard
|
||||
|
|
|
@ -5,7 +5,7 @@ kind: Kustomization
|
|||
images:
|
||||
- name: git.ar21.de/yolokube/dashboard
|
||||
newName: git.ar21.de/yolokube/dashboard
|
||||
newTag: staging-170
|
||||
newTag: staging-191
|
||||
namespace: dashboard-staging
|
||||
patches:
|
||||
- patch: |-
|
||||
|
|
56
fail2ban-exporter/daemonset.yaml
Normal file
56
fail2ban-exporter/daemonset.yaml
Normal file
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
app: fail2ban-prometheus-exporter
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-prometheus-exporter
|
||||
name: fail2ban-prometheus-exporter
|
||||
namespace: fail2ban-prometheus
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fail2ban-prometheus-exporter
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fail2ban-prometheus-exporter
|
||||
app.kubernetes.io/instance: fail2ban
|
||||
app.kubernetes.io/name: fail2ban-prometheus-exporter
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: F2B_GEOIP_SERVICE
|
||||
value: fail2ban-geoip
|
||||
image: git.ar21.de/yolokube/fail2ban-prometheus-exporter:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: fail2ban-prometheus-exporter
|
||||
ports:
|
||||
- containerPort: 9191
|
||||
name: http-metrics
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
cpu: 800m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 32Mi
|
||||
volumeMounts:
|
||||
- mountPath: /var/run/fail2ban/fail2ban.sock
|
||||
name: fail2ban
|
||||
readOnly: true
|
||||
serviceAccountName: fail2ban-prometheus-exporter-service-account
|
||||
tolerations:
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/master
|
||||
operator: Exists
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/control-plane
|
||||
operator: Exists
|
||||
volumes:
|
||||
- hostPath:
|
||||
path: /var/run/fail2ban/fail2ban.sock
|
||||
type: ""
|
||||
name: fail2ban
|
64
fail2ban-exporter/deployment.yaml
Normal file
64
fail2ban-exporter/deployment.yaml
Normal file
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: fail2ban-geoip
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-geoip
|
||||
name: fail2ban-geoip
|
||||
namespace: fail2ban-prometheus
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fail2ban-geoip
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fail2ban-geoip
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-geoip
|
||||
spec:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- fail2ban-geoip
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 1
|
||||
containers:
|
||||
- env:
|
||||
- name: GEOIP_LISTEN_ADDRESS
|
||||
value: :8080
|
||||
- name: GEOIP_DATA_URL
|
||||
value: https://data.neuber.io/data.csv
|
||||
image: git.ar21.de/yolokube/country-geo-locations:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: fail2ban-geoip
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
httpHeaders:
|
||||
- name: Accept
|
||||
value: application/json
|
||||
path: /api/v1/location/1.1.1.1
|
||||
port: http
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 2
|
||||
resources:
|
||||
limits:
|
||||
cpu: "2"
|
||||
memory: 4Gi
|
||||
requests:
|
||||
cpu: "1.5"
|
||||
memory: 3.5Gi
|
||||
serviceAccountName: fail2ban-geoip-service-account
|
17
fail2ban-exporter/kustomization.yaml
Normal file
17
fail2ban-exporter/kustomization.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
resources:
|
||||
- ./namespace.yaml
|
||||
- ./serviceaccount.yaml
|
||||
- ./daemonset.yaml
|
||||
- ./deployment.yaml
|
||||
- ./service.yaml
|
||||
- ./servicemonitor.yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
images:
|
||||
- name: git.ar21.de/yolokube/country-geo-locations
|
||||
newName: git.ar21.de/yolokube/country-geo-locations
|
||||
newTag: "31"
|
||||
- name: git.ar21.de/yolokube/fail2ban-prometheus-exporter
|
||||
newName: git.ar21.de/yolokube/fail2ban-prometheus-exporter
|
||||
newTag: "52"
|
||||
namespace: fail2ban-prometheus
|
8
fail2ban-exporter/namespace.yaml
Normal file
8
fail2ban-exporter/namespace.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
prometheus: yolokube
|
||||
name: fail2ban-prometheus
|
38
fail2ban-exporter/service.yaml
Normal file
38
fail2ban-exporter/service.yaml
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
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
|
||||
port: 80
|
||||
targetPort: http
|
||||
selector:
|
||||
app: fail2ban-geoip
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: fail2ban-prometheus-exporter
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-prometheus-exporter
|
||||
name: fail2ban-prometheus-exporter
|
||||
namespace: fail2ban-prometheus
|
||||
spec:
|
||||
internalTrafficPolicy: Cluster
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: 9191
|
||||
protocol: TCP
|
||||
targetPort: 9191
|
||||
selector:
|
||||
app: fail2ban-prometheus-exporter
|
||||
type: ClusterIP
|
18
fail2ban-exporter/serviceaccount.yaml
Normal file
18
fail2ban-exporter/serviceaccount.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-geoip
|
||||
name: fail2ban-geoip-service-account
|
||||
namespace: fail2ban-prometheus
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-prometheus-exporter
|
||||
name: fail2ban-prometheus-exporter-service-account
|
||||
namespace: fail2ban-prometheus
|
28
fail2ban-exporter/servicemonitor.yaml
Normal file
28
fail2ban-exporter/servicemonitor.yaml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
labels:
|
||||
app: fail2ban-prometheus-exporter
|
||||
app.kubernetes.io/instance: fail2ban-prometheus
|
||||
app.kubernetes.io/name: fail2ban-prometheus-exporter
|
||||
name: fail2ban-prometheus-servicemonitor
|
||||
namespace: fail2ban-prometheus
|
||||
spec:
|
||||
attachMetadata:
|
||||
node: false
|
||||
endpoints:
|
||||
- interval: 30s
|
||||
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-prometheus-exporter
|
Loading…
Add table
Reference in a new issue