easzup: 离线保存及加载kubeasz镜像

pull/641/head
gjmzj 2019-06-29 18:46:50 +08:00
parent 06c811203d
commit a3db781926
1 changed files with 7 additions and 0 deletions

View File

@ -186,6 +186,10 @@ function get_offline_image() {
docker pull traefik:${traefikVer} && \
docker save -o ${imageDir}/traefik_${traefikVer}.tar traefik:${traefikVer}
fi
if [[ ! -f "$imageDir/kubeasz_$KUBEASZ_VER.tar" ]];then
docker pull easzlab/kubeasz:${KUBEASZ_VER} && \
docker save -o ${imageDir}/kubeasz_${KUBEASZ_VER}.tar easzlab/kubeasz:${KUBEASZ_VER}
fi
}
function download_all() {
@ -203,6 +207,9 @@ function start_kubeasz_docker() {
host_if=$(ip route|grep default|cut -d' ' -f5)
host_ip=$(ip a|grep "$host_if$"|awk '{print $2}'|cut -d'/' -f1)
echo "[INFO] get host IP: $host_ip"
#
docker load -i /etc/ansible/down/kubeasz_${KUBEASZ_VER}.tar
# run kubeasz docker container
echo "[INFO] run kubeasz in a container"