|
|
@@ -14,22 +14,46 @@ |
|
|
# See the License for the specific language governing permissions and |
|
|
# See the License for the specific language governing permissions and |
|
|
# limitations under the License. |
|
|
# limitations under the License. |
|
|
|
|
|
|
|
|
|
|
|
# Influential env vars: |
|
|
|
|
|
# |
|
|
|
|
|
# SEDNA_GM_NODE | required | The node which Sedna gm will be deployed at |
|
|
|
|
|
# SEDNA_ACTION | optional | 'create'/'clean', default is 'create' |
|
|
|
|
|
# SEDNA_VERSION | optional | The Sedna version to be installed. |
|
|
|
|
|
# if not specified, it will get latest release version. |
|
|
|
|
|
# SEDNA_ROOT | optional | The Sedna offline directory |
|
|
|
|
|
|
|
|
set -o errexit |
|
|
set -o errexit |
|
|
set -o nounset |
|
|
set -o nounset |
|
|
set -o pipefail |
|
|
set -o pipefail |
|
|
|
|
|
|
|
|
SEDNA_VERSION=v0.3.0 |
|
|
|
|
|
KB_VERSION=v0.3.0 |
|
|
|
|
|
|
|
|
|
|
|
TMP_DIR=$(mktemp -d --suffix=.sedna) |
|
|
TMP_DIR=$(mktemp -d --suffix=.sedna) |
|
|
SEDNA_ROOT=${SEDNA_ROOT:-$TMP_DIR} |
|
|
SEDNA_ROOT=${SEDNA_ROOT:-$TMP_DIR} |
|
|
|
|
|
|
|
|
GM_NODE_NAME=${SEDNA_GM_NODE:-} |
|
|
GM_NODE_NAME=${SEDNA_GM_NODE:-} |
|
|
KB_NODE_NAME=${SEDNA_GM_NODE:-} |
|
|
KB_NODE_NAME=${SEDNA_GM_NODE:-} |
|
|
|
|
|
|
|
|
|
|
|
DEFAULT_SEDNA_VERSION=v0.4.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trap "rm -rf '$TMP_DIR'" EXIT |
|
|
trap "rm -rf '$TMP_DIR'" EXIT |
|
|
|
|
|
|
|
|
|
|
|
get_latest_version() { |
|
|
|
|
|
# get Sedna latest release version |
|
|
|
|
|
local repo=kubeedge/sedna |
|
|
|
|
|
# output of this latest page: |
|
|
|
|
|
# ... |
|
|
|
|
|
# "tag_name": "v1.0.0", |
|
|
|
|
|
# ... |
|
|
|
|
|
{ |
|
|
|
|
|
curl -s https://api.github.com/repos/$repo/releases/latest | |
|
|
|
|
|
awk '/"tag_name":/&&$0=$2' | |
|
|
|
|
|
sed 's/[",]//g' |
|
|
|
|
|
} || echo $DEFAULT_SEDNA_VERSION # fallback |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
: ${SEDNA_VERSION:=$(get_latest_version)} |
|
|
|
|
|
: ${KB_VERSION:=v0.3.0} |
|
|
|
|
|
|
|
|
_download_yamls() { |
|
|
_download_yamls() { |
|
|
|
|
|
|
|
|
yaml_dir=$1 |
|
|
yaml_dir=$1 |
|
|
@@ -332,6 +356,7 @@ delete_lc() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
wait_ok() { |
|
|
wait_ok() { |
|
|
|
|
|
echo "Waiting control components to be ready..." |
|
|
kubectl -n sedna wait --for=condition=available --timeout=600s deployment/gm |
|
|
kubectl -n sedna wait --for=condition=available --timeout=600s deployment/gm |
|
|
kubectl -n sedna wait pod --for=condition=Ready --selector=sedna |
|
|
kubectl -n sedna wait pod --for=condition=Ready --selector=sedna |
|
|
kubectl -n sedna get pod |
|
|
kubectl -n sedna get pod |
|
|
@@ -396,6 +421,7 @@ do_check |
|
|
prepare |
|
|
prepare |
|
|
case "$action" in |
|
|
case "$action" in |
|
|
create) |
|
|
create) |
|
|
|
|
|
echo "Installing Sedna $SEDNA_VERSION..." |
|
|
prepare_install |
|
|
prepare_install |
|
|
create_crds |
|
|
create_crds |
|
|
create_kb |
|
|
create_kb |
|
|
|