Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Juju kube up #23440

Merged
merged 1 commit into from
Apr 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 15 additions & 10 deletions cluster/juju/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ KUBE_ROOT=$(readlink -m ${JUJU_PATH}/../../)
source "${JUJU_PATH}/${KUBE_CONFIG_FILE-config-default.sh}"
# This attempts installation of Juju - This really needs to support multiple
# providers/distros - but I'm super familiar with ubuntu so assume that for now.
source ${JUJU_PATH}/prereqs/ubuntu-juju.sh
export JUJU_REPOSITORY=${JUJU_PATH}/charms
KUBE_BUNDLE_PATH=${JUJU_PATH}/bundles/local.yaml
source "${JUJU_PATH}/prereqs/ubuntu-juju.sh"
export JUJU_REPOSITORY="${JUJU_PATH}/charms"
KUBE_BUNDLE_PATH="${JUJU_PATH}/bundles/local.yaml"
# The directory for the kubectl binary, this is one of the paths in kubectl.sh.
KUBECTL_DIR="${KUBE_ROOT}/platforms/linux/amd64"


function build-local() {
Expand Down Expand Up @@ -78,23 +80,26 @@ function kube-up() {
detect-master
detect-nodes

local prefix=$RANDOM
export KUBECONFIG=/tmp/${prefix}/config
# Copy the cert and key to this machine.
# Copy kubectl, the cert and key to this machine from master.
(
umask 077
mkdir -p /tmp/${prefix}
juju scp ${KUBE_MASTER_NAME}:kubectl_package.tar.gz /tmp/${prefix}/
ls -al /tmp/${prefix}/
tar xfz /tmp/${prefix}/kubectl_package.tar.gz -C /tmp/${prefix}
mkdir -p ${KUBECTL_DIR}
juju scp ${KUBE_MASTER_NAME}:kubectl_package.tar.gz ${KUBECTL_DIR}
tar xfz ${KUBECTL_DIR}/kubectl_package.tar.gz -C ${KUBECTL_DIR}
)
# Export the location of the kubectl configuration file.
export KUBECONFIG="${KUBECTL_DIR}/config"
}

function kube-down() {
local force="${1-}"
local jujuenv
jujuenv=$(juju switch)
juju destroy-model ${jujuenv} ${force} || true
# Clean up the generated charm files.
rm -rf ${KUBE_ROOT}/cluster/juju/charms
# Clean up the kubectl binary and config file.
rm -rf ${KUBECTL_DIR}
}

function prepare-e2e() {
Expand Down