Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from klausenbusk/portmap
Browse files Browse the repository at this point in the history
Enable "portmap" plugin by default
  • Loading branch information
dghubble authored Sep 12, 2017
2 parents 5a06b2b + 70e0e1b commit 5fc4e35
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ ADD dist/host-local /opt/cni/bin/host-local
ADD dist/vlan /opt/cni/bin/vlan

ADD install-cni.sh /install-cni.sh
ADD flannel.conf.default /flannel.conf.default
ADD flannel.conflist.default /flannel.conflist.default
7 changes: 0 additions & 7 deletions flannel.conf.default

This file was deleted.

18 changes: 18 additions & 0 deletions flannel.conflist.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "cbr0",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "flannel",
"delegate": {
"isDefaultGateway": true
}
},
{
"type": "portmap",
"capabilities": {
"portMappings": true
}
}
]
}
14 changes: 9 additions & 5 deletions install-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ if [ -w "/host/opt/cni/bin/" ]; then
echo "Wrote CNI binaries to /host/opt/cni/bin/";
fi;

TMP_CONF='/flannel.conf.default'
TMP_CONF='/flannel.conflist.default'
# If specified, overwrite the network configuration file.
if [ "${CNI_NETWORK_CONFIG:-}" != "" ]; then
cat >$TMP_CONF <<EOF
${CNI_NETWORK_CONFIG:-}
EOF
fi

FILENAME=${CNI_CONF_NAME:-10-flannel.conf}
mv $TMP_CONF /host/etc/cni/net.d/${FILENAME}
echo "Wrote CNI config: $(cat /host/etc/cni/net.d/${FILENAME})"
CNI_CONF_NAME="${CNI_CONF_NAME:-10-flannel.conflist}"
CNI_OLD_NAME="${CNI_OLD_NAME:-10-flannel.conf}"
if [ "${CNI_CONF_NAME}" != "${CNI_OLD_NAME}" ]; then
rm -f "/host/etc/cni/net.d/${CNI_OLD_NAME}"
fi
mv $TMP_CONF /host/etc/cni/net.d/${CNI_CONF_NAME}
echo "Wrote CNI config: $(cat /host/etc/cni/net.d/${CNI_CONF_NAME})"

while :; do sleep 3600; done;
while :; do sleep 3600; done;

0 comments on commit 5fc4e35

Please sign in to comment.