Browse Source

[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
changes/98/662098/2
Lingxian Kong 2 years ago
parent
commit
49e5f17cb5
2 changed files with 21 additions and 0 deletions
  1. +16
    -0
      magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh
  2. +5
    -0
      releasenotes/notes/ignore-calico-devices-in-network-manager-e1bdb052834e11e9.yaml

+ 16
- 0
magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh 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}


+ 5
- 0
releasenotes/notes/ignore-calico-devices-in-network-manager-e1bdb052834e11e9.yaml 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.

Loading…
Cancel
Save