Skip to content

Commit

Permalink
configure multus to use symlinked current SNAP_DATA locations (#1502)
Browse files Browse the repository at this point in the history
  • Loading branch information
apnar authored Aug 20, 2020
1 parent 500e5f4 commit 8522472
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions microk8s-resources/actions/enable.multus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
source "${SNAP}/actions/common/utils.sh"

KUBECTL="${SNAP}/kubectl --kubeconfig=${SNAP_DATA}/credentials/client.config"
CUR_DATA=$(dirname "${SNAP_DATA}")/current

echo "Enabling Multus"

Expand All @@ -16,7 +17,7 @@ else
"${SNAP}/microk8s-status.wrapper" --wait-ready >/dev/null

echo "Applying manifest for multus daemonset."
cat "${SNAP}/actions/multus.yaml" | "${SNAP}/bin/sed" "s#{{SNAP_DATA}}#${SNAP_DATA}#g" | ${KUBECTL} apply -f -
cat "${SNAP}/actions/multus.yaml" | "${SNAP}/bin/sed" "s#{{SNAP_DATA}}#${CUR_DATA}#g" | ${KUBECTL} apply -f -

echo -n "Waiting for multus daemonset to start."
until [ -f "${SNAP_DATA}/opt/cni/bin/multus" ]; do
Expand All @@ -35,7 +36,7 @@ echo "Currently installed CNI and IPAM plugins include:"
echo $(cd "${SNAP_DATA}/opt/cni/bin/"; ls)

echo
echo "New CNI plugins can be installed in ${SNAP_DATA}/opt/cni/bin/"
echo "New CNI plugins can be installed in ${CUR_DATA}/opt/cni/bin/"

echo
echo "For information on configuration please refer to the multus documentation."
Expand Down

0 comments on commit 8522472

Please sign in to comment.