mirror of https://github.com/easzlab/kubeasz.git
修改当context不存在时,easzctl setup默认安装在default context
parent
4509001ea6
commit
fd22fb6db2
|
@ -240,11 +240,13 @@ function checkout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
[ -d "$BASEPATH/.cluster" ] || { echo "[ERROR] invalid context, run 'easzctl checkout <cluster_name>' first"; return 1; }
|
|
||||||
save_context
|
|
||||||
[ -f "$BASEPATH/bin/kube-apiserver" ] || { echo "[ERROR] no binaries found, download then fist"; return 1; }
|
[ -f "$BASEPATH/bin/kube-apiserver" ] || { echo "[ERROR] no binaries found, download then fist"; return 1; }
|
||||||
[ -f "$BASEPATH/hosts" ] || { echo "[ERROR] no ansible hosts found, read 'docs/setup/00-planning_and_overall_intro.md'"; return 1; }
|
[ -f "$BASEPATH/hosts" ] || { echo "[ERROR] no ansible hosts found, read 'docs/setup/00-planning_and_overall_intro.md'"; return 1; }
|
||||||
echo -e "\n[INFO] setup begin in 5s, press 'Enter' to abort\n:"
|
[ -d "$BASEPATH/.cluster" ] || checkout default
|
||||||
|
save_context
|
||||||
|
CLUSTER=$(cat $BASEPATH/.cluster/current_cluster)
|
||||||
|
echo -e "\n[INFO] setup cluster with context: $CLUSTER"
|
||||||
|
echo -e "[INFO] setup begin in 5s, press 'Enter' to abort\n:"
|
||||||
! (read -t 5 ANS) || { echo "[WARN] setup aborted"; return 1; }
|
! (read -t 5 ANS) || { echo "[WARN] setup aborted"; return 1; }
|
||||||
ansible-playbook $BASEPATH/90.setup.yml
|
ansible-playbook $BASEPATH/90.setup.yml
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue