Merge pull request #2 from whitmo/add-charms

Script and bundle tweaks
This commit is contained in:
Matt Bruzek 2015-04-22 10:27:11 -05:00
commit 4ce3b862c1
4 changed files with 17 additions and 9 deletions

View File

@ -9,11 +9,11 @@ kubernetes-local:
options: options:
version: "v0.15.0" version: "v0.15.0"
docker: docker:
charm: docker-0 charm: docker
branch: https://github.com/chuckbutler/docker-charm.git branch: https://github.com/chuckbutler/docker-charm.git
num_units: 2 num_units: 2
options: options:
latest: false latest: true
annotations: annotations:
"gui-x": "0" "gui-x": "0"
"gui-y": "0" "gui-y": "0"

1
cluster/juju/charms/trusty/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/docker

View File

@ -2,6 +2,7 @@ import httplib
import json import json
import time import time
class Registrator: class Registrator:
def __init__(self): def __init__(self):
@ -41,11 +42,10 @@ class Registrator:
body = response.read() body = response.read()
print(body) print(body)
result = json.loads(body) result = json.loads(body)
print("Response status:%s reason:%s body:%s" % ( print("Response status:%s reason:%s body:%s" % \
response.status, response.reason, result)) (response.status, response.reason, result))
return response, result return response, result
def update(self): def update(self):
''' Contact the API Server to update a registration ''' ''' Contact the API Server to update a registration '''
# do a get on the API for the node # do a get on the API for the node
@ -80,5 +80,3 @@ class Registrator:
print("Registration error") print("Registration error")
# TODO - get request data # TODO - get request data
raise RuntimeError("Unable to register machine with") raise RuntimeError("Unable to register machine with")

View File

@ -19,9 +19,11 @@ set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
KUBE_ROOT=$(readlink -f $KUBE_ROOT)
source $KUBE_ROOT/cluster/juju/prereqs/ubuntu-juju.sh source $KUBE_ROOT/cluster/juju/prereqs/ubuntu-juju.sh
export JUJU_REPOSITORY=${KUBE_ROOT}/cluster/juju/charms export JUJU_REPOSITORY=${KUBE_ROOT}/cluster/juju/charms
#KUBE_BUNDLE_URL='https://raw.githubusercontent.com/whitmo/bundle-kubernetes/master/bundles.yaml' #KUBE_BUNDLE_URL='https://raw.githubusercontent.com/whitmo/bundle-kubernetes/master/bundles.yaml'
KUBE_BUNDLE_PATH=${KUBE_ROOT}/cluster/juju/bundles/local.yaml KUBE_BUNDLE_PATH=${KUBE_ROOT}/cluster/juju/bundles/local.yaml
function verify-prereqs() { function verify-prereqs() {
gather_installation_reqs gather_installation_reqs
@ -103,10 +105,17 @@ function sleep-status(){
maxtime=900 maxtime=900
jujustatus='' jujustatus=''
echo "Waiting up to 15 minutes to allow the cluster to come online... wait for it..." 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 while [[ $i < $maxtime && $jujustatus != *"started"* ]]; do
sleep 15
i+=15
jujustatus=$(juju status kubernetes-master --format=oneline) jujustatus=$(juju status kubernetes-master --format=oneline)
sleep 30
i+=30
done done
# sleep because we cannot get the status back of where the minions are in the deploy phase # sleep because we cannot get the status back of where the minions are in the deploy phase