kubernetes: fix wireguard issue in qbittorrent-helm-chart
All checks were successful
ci/woodpecker/push/demo-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/demo-workflow Pipeline was successful
This commit is contained in:
@@ -9,7 +9,6 @@ data:
|
||||
Address = {{ .Values.wireguard.address }}
|
||||
PrivateKey = {{ .Values.wireguard.privateKey }}
|
||||
MTU = {{ .Values.wireguard.mtu }}
|
||||
DNS = {{ .Values.wireguard.dns }}
|
||||
ListenPort = {{ .Values.wireguard.listenPort }}
|
||||
|
||||
[Peer]
|
||||
@@ -17,4 +16,4 @@ data:
|
||||
PresharedKey = {{ .Values.wireguard.presharedKey }}
|
||||
AllowedIPs = {{ .Values.wireguard.allowedIPs }}
|
||||
Endpoint = {{ .Values.wireguard.endpoint }}
|
||||
PersistentKeepalive = {{ .Values.wireguard.persistentKeepalive }}
|
||||
PersistentKeepalive = {{ .Values.wireguard.persistentKeepalive }}
|
||||
|
||||
@@ -13,6 +13,14 @@ spec:
|
||||
labels:
|
||||
app: {{ .Release.Name }}
|
||||
spec:
|
||||
dnsPolicy: None
|
||||
dnsConfig:
|
||||
nameservers:
|
||||
- 10.128.0.1
|
||||
searches: []
|
||||
options:
|
||||
- name: ndots
|
||||
value: "1"
|
||||
initContainers:
|
||||
- name: wireguard-init
|
||||
image: {{ .Values.wireguardImage.repository }}:{{ .Values.wireguardImage.tag }}
|
||||
@@ -29,21 +37,18 @@ spec:
|
||||
- |
|
||||
set -x
|
||||
echo "Starting WireGuard initialization..."
|
||||
mkdir -p /etc/wireguard
|
||||
cp /config/wg_confs/wg0.conf /etc/wireguard/wg0.conf
|
||||
chmod 600 /etc/wireguard/wg0.conf
|
||||
|
||||
mkdir -p /run/wireguard
|
||||
cp /config/wg0.conf /run/wireguard/wg0.conf
|
||||
chmod 600 /run/wireguard/wg0.conf
|
||||
if ! lsmod | grep -q wireguard; then
|
||||
modprobe wireguard || echo "Failed to load wireguard module"
|
||||
fi
|
||||
|
||||
wg-quick up wg0 || echo "Failed to bring up WireGuard interface"
|
||||
|
||||
wg-quick up /run/wireguard/wg0.conf
|
||||
ip link show wg0
|
||||
wg show
|
||||
volumeMounts:
|
||||
- name: wireguard-config
|
||||
mountPath: /config/wg_confs
|
||||
mountPath: /config/
|
||||
- name: modules
|
||||
mountPath: /lib/modules
|
||||
containers:
|
||||
@@ -75,9 +80,7 @@ spec:
|
||||
- -c
|
||||
- |
|
||||
while true; do
|
||||
if ! ip link show wg0 > /dev/null 2>&1; then
|
||||
wg-quick up wg0
|
||||
fi
|
||||
ip link show wg0 >/dev/null 2>&1 || exit 1
|
||||
sleep 30
|
||||
done
|
||||
ports:
|
||||
@@ -122,4 +125,4 @@ spec:
|
||||
claimName: {{ .Values.persistence.downloads.existingClaim }}
|
||||
- name: modules
|
||||
hostPath:
|
||||
path: /lib/modules
|
||||
path: /lib/modules
|
||||
|
||||
Reference in New Issue
Block a user