feat(wireguard): setup K8s to FritzBox Site-to-Site VPN

This commit is contained in:
Moritz Graf
2026-05-17 10:36:06 +02:00
parent 6b3a5cd7c1
commit f203cd1f38
7 changed files with 119 additions and 1 deletions
+53
View File
@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: wireguard
namespace: wireguard
labels:
app: wireguard
spec:
replicas: 1
selector:
matchLabels:
app: wireguard
template:
metadata:
labels:
app: wireguard
spec:
hostNetwork: true
containers:
- name: wireguard
image: alpine:latest
command: ["/bin/sh", "-c"]
args:
- |
apk add --no-cache wireguard-tools iptables
cp /config/wg0.conf /etc/wireguard/wg0.conf
chmod 600 /etc/wireguard/wg0.conf
wg-quick up wg0
echo "Wireguard is up"
trap "wg-quick down wg0" SIGINT SIGTERM
sleep infinity &
wait
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
volumeMounts:
- name: wg-config
mountPath: /config/wg0.conf
subPath: wg0.conf
readOnly: true
- name: lib-modules
mountPath: /lib/modules
readOnly: true
volumes:
- name: wg-config
secret:
secretName: wireguard-config
- name: lib-modules
hostPath:
path: /lib/modules
+9
View File
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: wireguard
resources:
- namespace.yaml
- secret.secret.yaml
- deployment.yaml
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: wireguard
Binary file not shown.