Unverified Commit fa835cbd authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Ensure API_DOMAIN set

parent 53c4fda9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -37,3 +37,12 @@ fatal() {
	tput 'sgr0'
	exit ${CODE-1}
} >&2

info() {
	tput -S <<-!
		setaf 4
		bold
	!
	echo "Info: $*"
	tput 'sgr0'
} >&2
+3 −1
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ if [[ $(swapon --show --noheadings|wc -l) -gt 0 ]]; then
	fatal "Restart needed to disable swap"
fi

info "Configuring cluster with domain ${API_DOMAIN:=k8s.net.kodo.org.uk}"

if [[ -v INTERFACE ]]; then
	ip -j -4 addr show "$INTERFACE" |
		jq -r '.[].addr_info[] | select(.scope == "global") | .local' |
@@ -94,7 +96,7 @@ fi
if [[ ! -v TOKEN ]]; then
	# --domain/API_DOMAIN provides a DNS name which resolves to all control 
	# plane nodes
	kubeadm_args+=(--control-plane-endpoint=${API_DOMAIN:=k8s.net.kodo.org.uk})
	kubeadm_args+=("--control-plane-endpoint=${API_DOMAIN}")

	# We will use Cilium's kube-proxy replacement...
	kubeadm_args+=(--skip-phases=addon/kube-proxy)