Merge "k8s_fedora: Move rp_filter=1 for calico up" into stable/train

This commit is contained in:
Zuul 2019-10-11 20:18:08 +00:00 committed by Gerrit Code Review
commit 7aa1cec2b7
2 changed files with 4 additions and 4 deletions

View File

@ -31,6 +31,8 @@ $ssh_cmd mkdir -p /etc/cni/net.d/
_addtl_mounts=',{"type":"bind","source":"/opt/cni","destination":"/opt/cni","options":["bind","rw","slave","mode=777"]},{"type":"bind","source":"/var/lib/docker","destination":"/var/lib/docker","options":["bind","rw","slave","mode=755"]}'
if [ "$NETWORK_DRIVER" = "calico" ]; then
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
$ssh_cmd sysctl -p
if [ "`systemctl status NetworkManager.service | grep -o "Active: active"`" = "Active: active" ]; then
CALICO_NM=/etc/NetworkManager/conf.d/calico.conf
[ -f ${CALICO_NM} ] || {
@ -42,8 +44,6 @@ unmanaged-devices=interface-name:cali*;interface-name:tunl*
EOF
}
systemctl restart NetworkManager
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
$ssh_cmd sysctl -p
fi
fi

View File

@ -31,6 +31,8 @@ $ssh_cmd mkdir -p /etc/cni/net.d/
_addtl_mounts=',{"type":"bind","source":"/opt/cni","destination":"/opt/cni","options":["bind","rw","slave","mode=777"]},{"type":"bind","source":"/var/lib/docker","destination":"/var/lib/docker","options":["bind","rw","slave","mode=755"]}'
if [ "$NETWORK_DRIVER" = "calico" ]; then
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
$ssh_cmd sysctl -p
if [ "$($ssh_cmd systemctl status NetworkManager.service | grep -o "Active: active")" = "Active: active" ]; then
CALICO_NM=/etc/NetworkManager/conf.d/calico.conf
[ -f ${CALICO_NM} ] || {
@ -42,8 +44,6 @@ unmanaged-devices=interface-name:cali*;interface-name:tunl*
EOF
}
$ssh_cmd systemctl restart NetworkManager
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.conf
$ssh_cmd sysctl -p
fi
fi