kubernetes: avoid OS specifics in boot.sh
Remove `-publish` (which is currently Linux/QEMU specific) and replace with a
generic $KUBE_RUN_ARGS envvar. Usage:
KUBE_RUN_ARGS="-publish 2222:22" ./boot.sh
KUBE_PORT_BASE is thus obsolete and removed.
#!/bin/bash -eu
-: ${KUBE_PORT_BASE:=2222}
+: ${KUBE_RUN_ARGS:=}
if [ $# -eq 0 ] ; then
img="kube-master"
- port=${KUBE_PORT_BASE}
data=""
state="kube-master-state"
elif [ $# -gt 1 ] ; then
@@ -19,7 +18,6 @@ elif [ $# -gt 1 ] ; then
esac
img="kube-node"
name="node-${1}"
- port=$((${KUBE_PORT_BASE} + $1))
shift
data="${*}"
state="kube-${name}-state"
@@ -33,4 +31,4 @@ else
fi
set -x
rm -rf "${state}"
-../../bin/linuxkit run -publish $port:22 -cpus 2 -mem 4096 -state "${state}" -disk size=4G -data "${data}" "${img}"
+../../bin/linuxkit run ${KUBE_RUN_ARGS} -cpus 2 -mem 4096 -state "${state}" -disk size=4G -data "${data}" "${img}"
