|
|
@ -9,7 +9,7 @@ source "$CURR_DIR/common.sh" |
|
|
|
clustername="lifecycletest" |
|
|
|
clustername="lifecycletest" |
|
|
|
|
|
|
|
|
|
|
|
info "Creating cluster $clustername..." |
|
|
|
info "Creating cluster $clustername..." |
|
|
|
$EXE create cluster "$clustername" --workers 1 --api-port 6443 --wait --timeout 360s || failed "could not create cluster $clustername" |
|
|
|
$EXE cluster create "$clustername" --workers 1 --api-port 6443 --wait --timeout 360s || failed "could not create cluster $clustername" |
|
|
|
|
|
|
|
|
|
|
|
info "Sleeping for 5 seconds to give the cluster enough time to get ready..." |
|
|
|
info "Sleeping for 5 seconds to give the cluster enough time to get ready..." |
|
|
|
sleep 5 |
|
|
|
sleep 5 |
|
|
@ -23,14 +23,14 @@ check_multi_node "$clustername" 2 || failed "failed to verify number of nodes" |
|
|
|
|
|
|
|
|
|
|
|
# 2. stop the cluster |
|
|
|
# 2. stop the cluster |
|
|
|
info "Stopping cluster..." |
|
|
|
info "Stopping cluster..." |
|
|
|
$EXE stop cluster "$clustername" |
|
|
|
$EXE cluster stop "$clustername" |
|
|
|
|
|
|
|
|
|
|
|
info "Checking that cluster was stopped" |
|
|
|
info "Checking that cluster was stopped" |
|
|
|
check_clusters "$clustername" && failed "cluster was not stopped, since we still have access" |
|
|
|
check_clusters "$clustername" && failed "cluster was not stopped, since we still have access" |
|
|
|
|
|
|
|
|
|
|
|
# 3. start the cluster |
|
|
|
# 3. start the cluster |
|
|
|
info "Starting cluster..." |
|
|
|
info "Starting cluster..." |
|
|
|
$EXE start cluster "$clustername" --wait --timeout 360s || failed "cluster didn't come back in time" |
|
|
|
$EXE cluster start "$clustername" --wait --timeout 360s || failed "cluster didn't come back in time" |
|
|
|
|
|
|
|
|
|
|
|
info "Checking that we have access to the cluster..." |
|
|
|
info "Checking that we have access to the cluster..." |
|
|
|
check_clusters "$clustername" || failed "error checking cluster" |
|
|
|
check_clusters "$clustername" || failed "error checking cluster" |
|
|
@ -40,7 +40,7 @@ check_multi_node "$clustername" 2 || failed "failed to verify number of nodes" |
|
|
|
|
|
|
|
|
|
|
|
# 4. adding another worker node |
|
|
|
# 4. adding another worker node |
|
|
|
info "Adding one worker node..." |
|
|
|
info "Adding one worker node..." |
|
|
|
$EXE create node "extra-worker" --cluster "$clustername" --role "worker" --wait --timeout 360s || failed "failed to add worker node" |
|
|
|
$EXE node create "extra-worker" --cluster "$clustername" --role "worker" --wait --timeout 360s || failed "failed to add worker node" |
|
|
|
|
|
|
|
|
|
|
|
info "Checking that we have 3 nodes available now..." |
|
|
|
info "Checking that we have 3 nodes available now..." |
|
|
|
check_multi_node "$clustername" 3 || failed "failed to verify number of nodes" |
|
|
|
check_multi_node "$clustername" 3 || failed "failed to verify number of nodes" |
|
|
@ -49,12 +49,12 @@ check_multi_node "$clustername" 3 || failed "failed to verify number of nodes" |
|
|
|
info "Loading an image into the cluster..." |
|
|
|
info "Loading an image into the cluster..." |
|
|
|
docker pull nginx:latest > /dev/null |
|
|
|
docker pull nginx:latest > /dev/null |
|
|
|
docker tag nginx:latest nginx:local > /dev/null |
|
|
|
docker tag nginx:latest nginx:local > /dev/null |
|
|
|
$EXE load image nginx:local -c $clustername || failed "could not import image in $clustername" |
|
|
|
$EXE image import nginx:local -c $clustername || failed "could not import image in $clustername" |
|
|
|
|
|
|
|
|
|
|
|
# Cleanup |
|
|
|
# Cleanup |
|
|
|
|
|
|
|
|
|
|
|
info "Deleting cluster $clustername..." |
|
|
|
info "Deleting cluster $clustername..." |
|
|
|
$EXE delete cluster "$clustername" || failed "could not delete the cluster $clustername" |
|
|
|
$EXE cluster delete "$clustername" || failed "could not delete the cluster $clustername" |
|
|
|
|
|
|
|
|
|
|
|
exit 0 |
|
|
|
exit 0 |
|
|
|
|
|
|
|
|
|
|
|