From 94ff6bd876fb9db00fc7a0cd5d6dec6f6547862d Mon Sep 17 00:00:00 2001 From: Haytham Abuelfutuh Date: Wed, 10 Mar 2021 09:26:10 -0800 Subject: [PATCH] Allow K3s K8s Api Port to be overriden (#812) Signed-off-by: Haytham Abuelfutuh --- docker/sandbox/flyte-entrypoint-default.sh | 3 ++- docker/sandbox/flyte-entrypoint-dind.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/sandbox/flyte-entrypoint-default.sh b/docker/sandbox/flyte-entrypoint-default.sh index ce1cc8a0c0..5b5c3ceb1d 100755 --- a/docker/sandbox/flyte-entrypoint-default.sh +++ b/docker/sandbox/flyte-entrypoint-default.sh @@ -6,7 +6,8 @@ trap 'pkill -P $$' EXIT # Start k3s echo "Starting k3s cluster..." -k3s server --no-deploy=traefik --no-deploy=servicelb --no-deploy=local-storage --no-deploy=metrics-server &> /var/log/k3s.log & +KUBERNETES_API_PORT=${KUBERNETES_API_PORT:-6443} +k3s server --no-deploy=traefik --no-deploy=servicelb --no-deploy=local-storage --no-deploy=metrics-server --https-listen-port=${KUBERNETES_API_PORT} &> /var/log/k3s.log & K3S_PID=$! timeout 600 sh -c "until k3s kubectl explain deployment &> /dev/null; do sleep 1; done" || ( echo >&2 "Timed out while waiting for the Kubernetes cluster to start"; exit 1 ) echo "Done." diff --git a/docker/sandbox/flyte-entrypoint-dind.sh b/docker/sandbox/flyte-entrypoint-dind.sh index 39b7d7ce48..9db5613c34 100755 --- a/docker/sandbox/flyte-entrypoint-dind.sh +++ b/docker/sandbox/flyte-entrypoint-dind.sh @@ -23,7 +23,8 @@ echo "Done." # Start k3s echo "Starting k3s cluster..." -k3s server --docker --no-deploy=traefik --no-deploy=servicelb --no-deploy=local-storage --no-deploy=metrics-server &> /var/log/k3s.log & +KUBERNETES_API_PORT=${KUBERNETES_API_PORT:-6443} +k3s server --docker --no-deploy=traefik --no-deploy=servicelb --no-deploy=local-storage --no-deploy=metrics-server --https-listen-port=${KUBERNETES_API_PORT} &> /var/log/k3s.log & K3S_PID=$! timeout 600 sh -c "until k3s kubectl explain deployment &> /dev/null; do sleep 1; done" || ( echo >&2 "Timed out while waiting for the Kubernetes cluster to start"; exit 1 ) echo "Done."