diff --git a/doc/how-to-use.md b/doc/how-to-use.md index 00b327cf5..1bc53a2fa 100644 --- a/doc/how-to-use.md +++ b/doc/how-to-use.md @@ -537,3 +537,7 @@ Used only with `--multus-conf-file=auto`. Allows you to specify CNI spec version In some cases, the original CNI configuration that the Multus configuration was generated from (using `--multus-conf-file=auto`) may be used as a sort of semaphor for network readiness -- as this model is used by the Kubelet itself. If you need to disable Multus' availablity, you may wish to clean out the generated configuration file when the source file for autogeneration of the config file is no longer present. You can use this functionality by setting: --cleanup-config-on-exit=true + +When using CRIO, you may need to restart CRIO to get the Multus configuration file to take -- this is rarely necessary. + + --restart-crio=false diff --git a/images/entrypoint.sh b/images/entrypoint.sh index 861d3163e..1438f7a85 100755 --- a/images/entrypoint.sh +++ b/images/entrypoint.sh @@ -29,6 +29,7 @@ MULTUS_LOG_LEVEL="" MULTUS_LOG_FILE="" OVERRIDE_NETWORK_NAME=false MULTUS_CLEANUP_CONFIG_ON_EXIT=false +RESTART_CRIO=false # Give help text for parameters. function usage() @@ -54,6 +55,7 @@ function usage() echo -e "\t--multus-log-file=$MULTUS_LOG_FILE (empty by default, used only with --multus-conf-file=auto)" echo -e "\t--override-network-name=false (used only with --multus-conf-file=auto)" echo -e "\t--cleanup-config-on-exit=false (used only with --multus-conf-file=auto)" + echo -e "\t--restart-crio=false (restarts CRIO after config file is generated)" } function log() @@ -116,6 +118,9 @@ while [ "$1" != "" ]; do --cleanup-config-on-exit) MULTUS_CLEANUP_CONFIG_ON_EXIT=$VALUE ;; + --restart-crio) + RESTART_CRIO=$VALUE + ;; *) warn "unknown parameter \"$PARAM\"" ;; @@ -302,6 +307,11 @@ EOF echo $CONF > $CNI_CONF_DIR/00-multus.conf log "Config file created @ $CNI_CONF_DIR/00-multus.conf" echo $CONF + + if [ "$RESTART_CRIO" == true ]; then + log "Restarting crio" + systemctl restart crio + fi fi done fi diff --git a/images/multus-daemonset-crio.yml b/images/multus-daemonset-crio.yml index ddc79623d..24dce554e 100644 --- a/images/multus-daemonset-crio.yml +++ b/images/multus-daemonset-crio.yml @@ -150,7 +150,11 @@ spec: memory: "50Mi" securityContext: privileged: true + capabilities: + add: ["SYS_ADMIN"] volumeMounts: + - name: run + mountPath: /run - name: cni mountPath: /host/etc/cni/net.d - name: cnibin @@ -158,6 +162,9 @@ spec: - name: multus-cfg mountPath: /tmp/multus-conf volumes: + - name: run + hostPath: + path: /run - name: cni hostPath: path: /etc/cni/net.d