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

Add "setup --control" option

parent 5de7d827
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2,9 +2,11 @@
set -eu

USAGE="Usage:
$0 [-h] [-i INTERFACE] [-d DOMAIN] [-t TOKEN] [--skip-upgrade]
$0 [-h] [-c] [-i INTERFACE] [-d DOMAIN] [-t TOKEN] [--skip-upgrade]

-h|--help       Show this usage and exit
-c|--control    Make the node part of the control-plane, implied if --token is
                not provided.
-i|--interface  Use the first address of INTERFACE as a API advertisement address
-d|--domain     Use DOMAIN as the control plane nodes' shared DNS name
-t|--token      Join a cluster using TOKEN
@@ -28,6 +30,7 @@ while let $#; do
		-i|--interface) INTERFACE=$2; shift ;;
		-d|--domain) API_DOMAIN=$2; shift ;;
		-t|--token) TOKEN=$2; shift ;;
		-c|--control) CONTROL_PLANE=true ;;
		--skip-upgrade) SKIP_UPGRADE=true ;;
	esac
	shift
@@ -91,6 +94,8 @@ if [[ ! -v TOKEN ]]; then
	kubeadm_args+=(--pod-network-cidr=10.56.128.0/17)
fi

[[ -v CONTROL_PLANE ]] && kubeadm_args+=(--control-plane)

if [[ -v TOKEN ]]; then
	kubeadm join "${API_DOMAIN}" "$TOKEN" "${kubeadm_args[@]}"
else