From cc8104423029d46c3841e8042052a2e7705bc74b Mon Sep 17 00:00:00 2001 From: Whit Morriss Date: Wed, 22 Apr 2015 09:31:19 -0500 Subject: [PATCH 1/3] use git copy of docker charms for debugging --- cluster/juju/bundles/local.yaml | 4 ++-- cluster/juju/charms/trusty/.gitignore | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 cluster/juju/charms/trusty/.gitignore diff --git a/cluster/juju/bundles/local.yaml b/cluster/juju/bundles/local.yaml index e17b7e1e816..1ba1b38f23f 100644 --- a/cluster/juju/bundles/local.yaml +++ b/cluster/juju/bundles/local.yaml @@ -9,11 +9,11 @@ kubernetes-local: options: version: "v0.15.0" docker: - charm: docker-0 + charm: docker branch: https://github.com/chuckbutler/docker-charm.git num_units: 2 options: - latest: false + latest: true annotations: "gui-x": "0" "gui-y": "0" diff --git a/cluster/juju/charms/trusty/.gitignore b/cluster/juju/charms/trusty/.gitignore new file mode 100644 index 00000000000..b3d791e0788 --- /dev/null +++ b/cluster/juju/charms/trusty/.gitignore @@ -0,0 +1 @@ +/docker \ No newline at end of file From a57a64781a6fb5d27c73d3fe10d864c68a0465d5 Mon Sep 17 00:00:00 2001 From: Whit Morriss Date: Wed, 22 Apr 2015 09:31:45 -0500 Subject: [PATCH 2/3] scripting tweaks - use absolute path for kube_root (fixes JUJU_REPOSITORY directory creation issue) - shortcircuit status polling (for rerunning kubeup) - more granular polling iterations --- cluster/juju/util.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cluster/juju/util.sh b/cluster/juju/util.sh index 1e2065fd81a..1ba5fa2de4b 100755 --- a/cluster/juju/util.sh +++ b/cluster/juju/util.sh @@ -19,9 +19,11 @@ set -o errexit set -o nounset set -o pipefail +KUBE_ROOT=$(readlink -f $KUBE_ROOT) source $KUBE_ROOT/cluster/juju/prereqs/ubuntu-juju.sh export JUJU_REPOSITORY=${KUBE_ROOT}/cluster/juju/charms #KUBE_BUNDLE_URL='https://raw.githubusercontent.com/whitmo/bundle-kubernetes/master/bundles.yaml' + KUBE_BUNDLE_PATH=${KUBE_ROOT}/cluster/juju/bundles/local.yaml function verify-prereqs() { gather_installation_reqs @@ -103,10 +105,17 @@ function sleep-status(){ maxtime=900 jujustatus='' echo "Waiting up to 15 minutes to allow the cluster to come online... wait for it..." + + jujustatus=$(juju status kubernetes-master --format=oneline) + if [[ $jujustatus == *"started"* ]]; + then + return + fi + while [[ $i < $maxtime && $jujustatus != *"started"* ]]; do + sleep 15 + i+=15 jujustatus=$(juju status kubernetes-master --format=oneline) - sleep 30 - i+=30 done # sleep because we cannot get the status back of where the minions are in the deploy phase From 0ab77ae8be88bc030770ae5ef5dfb88199607fc5 Mon Sep 17 00:00:00 2001 From: Whit Morriss Date: Wed, 22 Apr 2015 09:36:05 -0500 Subject: [PATCH 3/3] line formatting --- .../charms/trusty/kubernetes/hooks/lib/registrator.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py b/cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py index e096110730d..d8a57f0a7aa 100644 --- a/cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py +++ b/cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py @@ -2,6 +2,7 @@ import httplib import json import time + class Registrator: def __init__(self): @@ -41,11 +42,10 @@ class Registrator: body = response.read() print(body) result = json.loads(body) - print("Response status:%s reason:%s body:%s" % ( - response.status, response.reason, result)) + print("Response status:%s reason:%s body:%s" % \ + (response.status, response.reason, result)) return response, result - def update(self): ''' Contact the API Server to update a registration ''' # do a get on the API for the node @@ -80,5 +80,3 @@ class Registrator: print("Registration error") # TODO - get request data raise RuntimeError("Unable to register machine with") - -