summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-10 16:32:10 +0000
committerGerrit Code Review <review@openstack.org>2018-10-10 16:32:10 +0000
commit2d171acd89e43844987c86e0a68ab6ceef651bcc (patch)
tree4d30493955b38dd336626d94208f2a3c66e3bc13
parent6133b489d4605d70874a68791c7f27b77bf9e024 (diff)
parent83b65b358d10cde53446a8bb33048c9c9e40c017 (diff)
Merge "Fix: Workaround kube-proxy keeping stale IPs"
-rw-r--r--charts/proxy/templates/bin/_liveness-probe.sh.tpl11
1 files changed, 11 insertions, 0 deletions
diff --git a/charts/proxy/templates/bin/_liveness-probe.sh.tpl b/charts/proxy/templates/bin/_liveness-probe.sh.tpl
index c00266a..81cfa56 100644
--- a/charts/proxy/templates/bin/_liveness-probe.sh.tpl
+++ b/charts/proxy/templates/bin/_liveness-probe.sh.tpl
@@ -21,6 +21,17 @@ if [[ $(iptables-save {{- if .Values.livenessProbe.whitelist }} | grep -Ev "${WH
21 FAILURE=1 21 FAILURE=1
22fi 22fi
23 23
24
25IPTABLES_IPS=$(iptables-save | grep -E 'KUBE-SEP.*to-destination' | sed 's/.*to-destination \(.*\):.*/\1/' | sort -u)
26KUBECTL_IPS=$(kubectl get --all-namespaces -o json endpoints | jq -r '.items | arrays | .[] | objects | .subsets | arrays | .[] | objects | .addresses | arrays | .[] | objects | .ip' | sort -u)
27
28if [[ $(comm -23 <(echo "${IPTABLES_IPS}") <(echo "${KUBECTL_IPS}")) ]]; then
29 FAILURE=1
30 echo "Found non-current Pod IPs in iptables rules:"
31 comm -23 <(echo "${IPTABLES_IPS}") <(echo "${KUBECTL_IPS}")
32fi
33
34
24if [[ "${FAILURE}" == "1" ]]; then 35if [[ "${FAILURE}" == "1" ]]; then
25 exit 1 36 exit 1
26fi 37fi