[k8s_fedora_atomic] Make calico devices unmanaged in NetworkManager config for master node

In https://review.opendev.org/#/c/548139/, we did the same change for
worker node, because kubelet is also installed on master nodes, we need
the same configuration, otherwise, the pods on master nodes won't work
properly(lost connection or timout frequently).

Story: #2005805
Task: #33544

Change-Id: I14c4dcdd1d73e2d94325974b4e55c1e37a20d9ea
This commit is contained in:
Lingxian Kong 2019-05-30 09:33:40 +12:00
parent 913636b6b1
commit 49e5f17cb5
2 changed files with 21 additions and 0 deletions

View File

@ -20,6 +20,22 @@ _prefix=${CONTAINER_INFRA_PREFIX:-docker.io/openstackmagnum/}
mkdir -p /opt/cni
_addtl_mounts=',{"type":"bind","source":"/opt/cni","destination":"/opt/cni","options":["bind","rw","slave","mode=777"]}'
if [ "$NETWORK_DRIVER" = "calico" ]; then
if [ "`systemctl status NetworkManager.service | grep -o "Active: active"`" = "Active: active" ]; then
CALICO_NM=/etc/NetworkManager/conf.d/calico.conf
[ -f ${CALICO_NM} ] || {
echo "Writing File: $CALICO_NM"
mkdir -p $(dirname ${CALICO_NM})
cat << EOF > ${CALICO_NM}
[keyfile]
unmanaged-devices=interface-name:cali*;interface-name:tunl*
EOF
}
systemctl restart NetworkManager
fi
fi
atomic install --storage ostree --system --set=ADDTL_MOUNTS=${_addtl_mounts} --system-package=no --name=kubelet ${_prefix}kubernetes-kubelet:${KUBE_TAG}
atomic install --storage ostree --system --system-package=no --name=kube-apiserver ${_prefix}kubernetes-apiserver:${KUBE_TAG}
atomic install --storage ostree --system --system-package=no --name=kube-controller-manager ${_prefix}kubernetes-controller-manager:${KUBE_TAG}

View File

@ -0,0 +1,5 @@
fixes:
- Fixed an issue that applications running on master nodes which rely on
network connection keep restarting because of timeout or connection lost,
by making calico devices unmanaged in NetworkManager config on master
nodes.