install incl agent ready

This commit is contained in:
baschno
2025-12-22 20:41:06 +01:00
parent 7a54346331
commit 4f5a18c84c
3 changed files with 46 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
# shellcheck disable=all
LOCAL_K8S_HOST={{ .Env.LOCAL_K8S_HOST }}
K8S_CONTEXT={{ .Env.K8S_CONTEXT }}
K8S_MASTER_NODE_NAME={{ .Env.K8S_MASTER_NODE_NAME }}
SERVER_IP={{ .Env.SERVER_IP }}
AGENT_IP={{ .Env.AGENT_IP }}

30
env/justfile vendored
View File

@@ -1,15 +1,20 @@
set fallback := true
export ENV_FILE := ".env.local"
export LOCAL_K8S_HOST := env("LOCAL_K8S_HOST", "")
export K8S_CONTEXT := env("K8S_CONTEXT", "")
export K8S_MASTER_NODE_NAME := env("K8S_MASTER_NODE_NAME", "")
export SERVER_IP := env("SERVER_IP", "")
export AGENT_IP := env("AGENT_IP", "")
check:
#!/bin/bash
set -euo pipefail
if [ -z "${LOCAL_K8S_HOST}" ]; then
echo "LOCAL_K8S_HOST is not set. Please execute 'just env::setup'" >&2
if [ -z "${K8S_CONTEXT}" ]; then
echo "K8S_CONTEXT is not set. Please execute 'just env::setup'" >&2
exit 1
fi
if [ -z "${K8S_MASTER_NODE_NAME}" ]; then
echo "K8S_MASTER_NODE_NAME is not set. Please execute 'just env::setup'" >&2
exit 1
fi
if [ -z "${SERVER_IP}" ]; then
@@ -27,7 +32,7 @@ setup:
if [ -f ../.env.local ]; then
echo ".env.local already exists." >&2
if gum confirm "Do you want to overwrite it?"; then
LOCAL_K8S_HOST=""
K8S_CONTEXT=""
SERVER_IP=""
AGENT_IP=""
elif [[ $? -eq 130 ]]; then
@@ -38,10 +43,19 @@ setup:
exit 1
fi
fi
while [ -z "${LOCAL_K8S_HOST}" ]; do
if ! LOCAL_K8S_HOST=$(
gum input --prompt="Internal k8s hostname (for SSH): " \
--width=100 --placeholder="k8s-host"
while [ -z "${K8S_CONTEXT}" ]; do
if ! K8S_CONTEXT=$(
gum input --prompt="Context name: " \
--width=100 --placeholder="context"
); then
echo "Setup cancelled." >&2
exit 1
fi
done
while [ -z "${K8S_MASTER_NODE_NAME}" ]; do
if ! K8S_MASTER_NODE_NAME=$(
gum input --prompt="Master Node Hostname: " \
--width=100 --placeholder="Master Node Name"
); then
echo "Setup cancelled." >&2
exit 1