Clean up stale ip rules on gluetun container start
An uncleanly exited gluetun leaves its ip rule in the shared pod network namespace; the restarted container then fails forever with 'adding ip rule 101: file exists' while the kill switch keeps blocking all egress. Apply the upstream-recommended Kubernetes fix: a postStart hook dropping table-51820 rules.
This commit is contained in:
1 file changed
+11
@@ -27,6 +27,17 @@ spec:
|
||||
- name: gluetun
|
||||
image: "qmcgaw/gluetun:{{ .Chart.AppVersion }}"
|
||||
imagePullPolicy: IfNotPresent
|
||||
# An uncleanly exited gluetun (crash, OOM, node issue) leaves its ip
|
||||
# rule behind in the shared pod network namespace, and the restarted
|
||||
# container then fails forever with "ip rule 101 ... file exists".
|
||||
# Upstream-recommended fix for Kubernetes: drop stale rules on start.
|
||||
lifecycle:
|
||||
postStart:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- (ip rule del table 51820; ip -6 rule del table 51820) || true
|
||||
env:
|
||||
- name: TZ
|
||||
value: {{ .Values.timezone | quote }}
|
||||
|
||||
Reference in new issue
Block a user