diff --git a/cluster/juju/bundles/local.yaml b/cluster/juju/bundles/local.yaml index 01ab4ebf99c..1ba1b38f23f 100644 --- a/cluster/juju/bundles/local.yaml +++ b/cluster/juju/bundles/local.yaml @@ -9,7 +9,7 @@ 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: 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 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") - - diff --git a/cluster/juju/util.sh b/cluster/juju/util.sh index a8c5499d47e..be97d4b14d4 100755 --- a/cluster/juju/util.sh +++ b/cluster/juju/util.sh @@ -106,10 +106,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