openshift-kni / install-scripts

Installation scripts for OpenShift KNI clusters
14 stars 20 forks source link

Multus doesn't work #123

Closed e-minguez closed 5 years ago

e-minguez commented 5 years ago

After installing CNV and OCS and due to https://bugzilla.redhat.com/show_bug.cgi?id=1732598 and https://github.com/intel/multus-cni/issues/325 it is required to replace the content on the file /etc/kubernetes/cni/net.d/80-openshift-network.conf with the following content:

{ "name": "openshift-sdn", "type": "multus", "namespaceIsolation": true, "logLevel": "verbose", "kubeconfig": "/etc/kubernetes/cni/net.d/multus.d/multus.kubeconfig", "delegates": [ { "cniVersion": "0.3.1", "name": "openshift-sdn", "type": "openshift-sdn" } ] }

This cannot be done via a machine-config because it is created by the openshift-cni pod and if the hosts are rebooted, the changes are lost.

The following script can be used as a temporary workaround:

#!/bin/sh
cat << EOF > 80-openshift-network.conf
{ "name": "openshift-sdn", "type": "multus", "namespaceIsolation": true, "logLevel": "verbose", "kubeconfig": "/etc/kubernetes/cni/net.d/multus.d/multus.kubeconfig", "delegates": [ { "cniVersion": "0.3.1", "name": "openshift-sdn", "type": "openshift-sdn" } ] }
EOF

for node in $(oc get nodes -o jsonpath="{.items[*].metadata.name}"); do
  scp 80-openshift-network.conf core@$node:/tmp/
  ssh core@$node "sudo mv /tmp/80-openshift-network.conf /etc/kubernetes/cni/net.d/80-openshift-network.conf"
done

echo "The multus changes will be lost if the hosts are rebooted"

Thoughts about adding this to the scripts?