feat(wireguard): add prometheus monitoring, alerts, and grafana dashboard
This commit is contained in:
@@ -7,6 +7,8 @@ metadata:
|
||||
app: wireguard
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: wireguard
|
||||
@@ -25,6 +27,7 @@ spec:
|
||||
apk add --no-cache wireguard-tools iptables
|
||||
cp /config/wg0.conf /etc/wireguard/wg0.conf
|
||||
chmod 600 /etc/wireguard/wg0.conf
|
||||
wg-quick down wg0 || true
|
||||
wg-quick up wg0
|
||||
echo "Wireguard is up"
|
||||
trap "wg-quick down wg0" SIGINT SIGTERM
|
||||
@@ -44,6 +47,25 @@ spec:
|
||||
- name: lib-modules
|
||||
mountPath: /lib/modules
|
||||
readOnly: true
|
||||
- name: exporter
|
||||
image: mindflavor/prometheus-wireguard-exporter:latest
|
||||
args:
|
||||
- "-n"
|
||||
- "/config/wg0.conf"
|
||||
ports:
|
||||
- name: http-metrics
|
||||
containerPort: 9586
|
||||
protocol: TCP
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
volumeMounts:
|
||||
- name: wg-config
|
||||
mountPath: /config/wg0.conf
|
||||
subPath: wg0.conf
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: wg-config
|
||||
secret:
|
||||
|
||||
Reference in New Issue
Block a user