mirror of https://github.com/k3s-io/k3s
commit
b255e7c478
|
@ -471,31 +471,6 @@ function ensure-temp-dir {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Verify and find the various tar files that we are going to use on the server.
|
|
||||||
#
|
|
||||||
# Vars set:
|
|
||||||
# SERVER_BINARY_TAR
|
|
||||||
# SALT_TAR
|
|
||||||
function find-release-tars {
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SALT_TAR="${KUBE_ROOT}/server/kubernetes-salt.tar.gz"
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
SALT_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-salt.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-salt.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Take the local tar files and upload them to S3. They will then be
|
# Take the local tar files and upload them to S3. They will then be
|
||||||
# downloaded by the master as part of the start up script for the master.
|
# downloaded by the master as part of the start up script for the master.
|
||||||
#
|
#
|
||||||
|
|
|
@ -94,32 +94,6 @@ function ensure-temp-dir {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Verify and find the various tar files that we are going to use on the server.
|
|
||||||
#
|
|
||||||
# Vars set:
|
|
||||||
# SERVER_BINARY_TAR
|
|
||||||
# SALT_TAR
|
|
||||||
function find-release-tars {
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SALT_TAR="${KUBE_ROOT}/server/kubernetes-salt.tar.gz"
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
SALT_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-salt.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-salt.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Take the local tar files and upload them to Azure Storage. They will then be
|
# Take the local tar files and upload them to Azure Storage. They will then be
|
||||||
# downloaded by the master as part of the start up script for the master.
|
# downloaded by the master as part of the start up script for the master.
|
||||||
#
|
#
|
||||||
|
|
|
@ -255,10 +255,10 @@ function set_binary_version() {
|
||||||
# use local dev binaries.
|
# use local dev binaries.
|
||||||
#
|
#
|
||||||
# Assumed vars:
|
# Assumed vars:
|
||||||
|
# KUBE_VERSION
|
||||||
# KUBE_VERSION_REGEX
|
# KUBE_VERSION_REGEX
|
||||||
# KUBE_CI_VERSION_REGEX
|
# KUBE_CI_VERSION_REGEX
|
||||||
# Vars set:
|
# Vars set:
|
||||||
# KUBE_TAR_URL
|
|
||||||
# KUBE_TAR_HASH
|
# KUBE_TAR_HASH
|
||||||
# SERVER_BINARY_TAR_URL
|
# SERVER_BINARY_TAR_URL
|
||||||
# SERVER_BINARY_TAR_HASH
|
# SERVER_BINARY_TAR_HASH
|
||||||
|
@ -269,38 +269,55 @@ function tars_from_version() {
|
||||||
find-release-tars
|
find-release-tars
|
||||||
upload-server-tars
|
upload-server-tars
|
||||||
elif [[ ${KUBE_VERSION} =~ ${KUBE_VERSION_REGEX} ]]; then
|
elif [[ ${KUBE_VERSION} =~ ${KUBE_VERSION_REGEX} ]]; then
|
||||||
KUBE_TAR_URL="https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes.tar.gz"
|
|
||||||
SERVER_BINARY_TAR_URL="https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes-server-linux-amd64.tar.gz"
|
SERVER_BINARY_TAR_URL="https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes-server-linux-amd64.tar.gz"
|
||||||
SALT_TAR_URL="https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes-salt.tar.gz"
|
SALT_TAR_URL="https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes-salt.tar.gz"
|
||||||
elif [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then
|
elif [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then
|
||||||
KUBE_TAR_URL="https://storage.googleapis.com/kubernetes-release/ci/${KUBE_VERSION}/kubernetes.tar.gz"
|
|
||||||
SERVER_BINARY_TAR_URL="https://storage.googleapis.com/kubernetes-release/ci/${KUBE_VERSION}/kubernetes-server-linux-amd64.tar.gz"
|
SERVER_BINARY_TAR_URL="https://storage.googleapis.com/kubernetes-release/ci/${KUBE_VERSION}/kubernetes-server-linux-amd64.tar.gz"
|
||||||
SALT_TAR_URL="https://storage.googleapis.com/kubernetes-release/ci/${KUBE_VERSION}/kubernetes-salt.tar.gz"
|
SALT_TAR_URL="https://storage.googleapis.com/kubernetes-release/ci/${KUBE_VERSION}/kubernetes-salt.tar.gz"
|
||||||
else
|
else
|
||||||
echo "Version doesn't match regexp" >&2
|
echo "Version doesn't match regexp" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
until KUBE_TAR_HASH=$(curl --fail --silent "${KUBE_TAR_URL}.sha1"); do
|
if ! SERVER_BINARY_TAR_HASH=$(curl -Ss --fail "${SERVER_BINARY_TAR_URL}.sha1"); then
|
||||||
echo "Failure trying to curl release .sha1"
|
echo "Failure trying to curl release .sha1"
|
||||||
done
|
|
||||||
until SERVER_BINARY_TAR_HASH=$(curl --fail --silent "${SERVER_BINARY_TAR_URL}.sha1"); do
|
|
||||||
echo "Failure trying to curl release .sha1"
|
|
||||||
done
|
|
||||||
until SALT_TAR_HASH=$(curl --fail --silent "${SALT_TAR_URL}.sha1"); do
|
|
||||||
echo "Failure trying to curl Salt tar .sha1"
|
|
||||||
done
|
|
||||||
|
|
||||||
if ! curl -Ss --range 0-1 "${KUBE_TAR_URL}" >&/dev/null; then
|
|
||||||
echo "Can't find release at ${KUBE_TAR_URL}" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
if ! curl -Ss --range 0-1 "${SERVER_BINARY_TAR_URL}" >&/dev/null; then
|
if ! SALT_TAR_HASH=$(curl -Ss --fail "${SALT_TAR_URL}.sha1"); then
|
||||||
|
echo "Failure trying to curl Salt tar .sha1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! curl -Ss --head "${SERVER_BINARY_TAR_URL}" >&/dev/null; then
|
||||||
echo "Can't find release at ${SERVER_BINARY_TAR_URL}" >&2
|
echo "Can't find release at ${SERVER_BINARY_TAR_URL}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! curl -Ss --range 0-1 "${SALT_TAR_URL}" >&/dev/null; then
|
if ! curl -Ss --head "${SALT_TAR_URL}" >&/dev/null; then
|
||||||
echo "Can't find Salt tar at ${SALT_TAR_URL}" >&2
|
echo "Can't find Salt tar at ${SALT_TAR_URL}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Verify and find the various tar files that we are going to use on the server.
|
||||||
|
#
|
||||||
|
# Assumed vars:
|
||||||
|
# KUBE_ROOT
|
||||||
|
# Vars set:
|
||||||
|
# SERVER_BINARY_TAR
|
||||||
|
# SALT_TAR
|
||||||
|
function find-release-tars() {
|
||||||
|
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
||||||
|
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
||||||
|
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
||||||
|
fi
|
||||||
|
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
||||||
|
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SALT_TAR="${KUBE_ROOT}/server/kubernetes-salt.tar.gz"
|
||||||
|
if [[ ! -f "$SALT_TAR" ]]; then
|
||||||
|
SALT_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-salt.tar.gz"
|
||||||
|
fi
|
||||||
|
if [[ ! -f "$SALT_TAR" ]]; then
|
||||||
|
echo "!!! Cannot find kubernetes-salt.tar.gz" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
@ -115,31 +115,6 @@ function ensure-temp-dir {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Verify and find the various tar files that we are going to use on the server.
|
|
||||||
#
|
|
||||||
# Vars set:
|
|
||||||
# SERVER_BINARY_TAR
|
|
||||||
# SALT_TAR
|
|
||||||
function find-release-tars {
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SALT_TAR="${KUBE_ROOT}/server/kubernetes-salt.tar.gz"
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
SALT_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-salt.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-salt.tar.gz" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use the gcloud defaults to find the project. If it is already set in the
|
# Use the gcloud defaults to find the project. If it is already set in the
|
||||||
# environment then go with that.
|
# environment then go with that.
|
||||||
#
|
#
|
||||||
|
|
|
@ -250,17 +250,6 @@ function kube-down {
|
||||||
destroy-network
|
destroy-network
|
||||||
}
|
}
|
||||||
|
|
||||||
function find-release-tars {
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# The kubernetes binaries are pushed to a host directory which is exposed to the VM
|
# The kubernetes binaries are pushed to a host directory which is exposed to the VM
|
||||||
function upload-server-tars {
|
function upload-server-tars {
|
||||||
tar -x -C "$POOL_PATH/kubernetes" -f "$SERVER_BINARY_TAR" kubernetes
|
tar -x -C "$POOL_PATH/kubernetes" -f "$SERVER_BINARY_TAR" kubernetes
|
||||||
|
|
|
@ -66,19 +66,6 @@ rax-ssh-key() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
find-release-tars() {
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
RELEASE_DIR="${KUBE_ROOT}/server/"
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
RELEASE_DIR="${KUBE_ROOT}/_output/release-tars/"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
rackspace-set-vars() {
|
rackspace-set-vars() {
|
||||||
|
|
||||||
CLOUDFILES_CONTAINER="kubernetes-releases-${OS_USERNAME}"
|
CLOUDFILES_CONTAINER="kubernetes-releases-${OS_USERNAME}"
|
||||||
|
@ -114,7 +101,7 @@ ensure_dev_container() {
|
||||||
copy_dev_tarballs() {
|
copy_dev_tarballs() {
|
||||||
|
|
||||||
echo "cluster/rackspace/util.sh: Uploading to Cloud Files"
|
echo "cluster/rackspace/util.sh: Uploading to Cloud Files"
|
||||||
${SWIFTLY_CMD} put -i ${RELEASE_DIR}/kubernetes-server-linux-amd64.tar.gz \
|
${SWIFTLY_CMD} put -i ${SERVER_BINARY_TAR} \
|
||||||
${CLOUDFILES_CONTAINER}/${CONTAINER_PREFIX}/kubernetes-server-linux-amd64.tar.gz > /dev/null 2>&1
|
${CLOUDFILES_CONTAINER}/${CONTAINER_PREFIX}/kubernetes-server-linux-amd64.tar.gz > /dev/null 2>&1
|
||||||
|
|
||||||
echo "Release pushed."
|
echo "Release pushed."
|
||||||
|
|
|
@ -126,31 +126,6 @@ function ensure-temp-dir {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Verify and find the various tar files that we are going to use on the server.
|
|
||||||
#
|
|
||||||
# Vars set:
|
|
||||||
# SERVER_BINARY_TAR
|
|
||||||
# SALT_TAR
|
|
||||||
function find-release-tars {
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
SERVER_BINARY_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SERVER_BINARY_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-server-linux-amd64.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SALT_TAR="${KUBE_ROOT}/server/kubernetes-salt.tar.gz"
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
SALT_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-salt.tar.gz"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SALT_TAR" ]]; then
|
|
||||||
echo "!!! Cannot find kubernetes-salt.tar.gz"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Take the local tar files and upload them to the master.
|
# Take the local tar files and upload them to the master.
|
||||||
#
|
#
|
||||||
# Assumed vars:
|
# Assumed vars:
|
||||||
|
|
|
@ -71,6 +71,12 @@ if [[ "${print_version}" == "true" ]]; then
|
||||||
echo "${KUBE_VERSION}"
|
echo "${KUBE_VERSION}"
|
||||||
else
|
else
|
||||||
echo "Using version at ${1}: ${KUBE_VERSION}" >&2
|
echo "Using version at ${1}: ${KUBE_VERSION}" >&2
|
||||||
tars_from_version
|
if [[ ${KUBE_VERSION} =~ ${KUBE_VERSION_REGEX} ]]; then
|
||||||
curl --fail -o kubernetes-${KUBE_VERSION}.tar.gz "${KUBE_TAR_URL}"
|
curl --fail -o kubernetes-${KUBE_VERSION}.tar.gz "https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/kubernetes.tar.gz"
|
||||||
|
elif [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then
|
||||||
|
curl --fail -o kubernetes-${KUBE_VERSION}.tar.gz "https://storage.googleapis.com/kubernetes-release/ci/${KUBE_VERSION}/kubernetes.tar.gz"
|
||||||
|
else
|
||||||
|
echo "Version doesn't match regexp" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue