Skip to content

Commit

Permalink
Merge pull request #2 from whitmo/add-charms
Browse files Browse the repository at this point in the history
Script and bundle tweaks
  • Loading branch information
Matt Bruzek committed Apr 22, 2015
2 parents e62d71c + 0ab77ae commit 4ce3b86
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cluster/juju/bundles/local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions cluster/juju/charms/trusty/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import time


class Registrator:

def __init__(self):
Expand Down Expand Up @@ -41,11 +42,10 @@ def register(self, hostname, port, api_path):
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
Expand Down Expand Up @@ -80,5 +80,3 @@ def command_succeeded(self, response, result):
print("Registration error")
# TODO - get request data
raise RuntimeError("Unable to register machine with")


13 changes: 11 additions & 2 deletions cluster/juju/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4ce3b86

Please sign in to comment.