From 54ddde0d434485b989fe41306d5d588c5789061d Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 24 Jul 2017 12:23:46 +0100 Subject: [PATCH] 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. Signed-off-by: Ian Campbell --- projects/kubernetes/boot.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/kubernetes/boot.sh b/projects/kubernetes/boot.sh index 2f69fc990..8c1dfc053 100755 --- a/projects/kubernetes/boot.sh +++ b/projects/kubernetes/boot.sh @@ -1,8 +1,7 @@ #!/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}"