3 # Copyright 2017 Aakash KT <aakashkt0@gmail.com> <aakash.kt@research.iiit.ac.in>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 function setup_docker() {
20 echo "Installing docker..."
21 sudo apt-get install -y docker.io
23 sudo docker login --username="aakashkt" --password="joid123"
26 function setup_clearwater() {
27 echo "Preparing docker images..."
29 git clone --recursive https://github.com/Metaswitch/clearwater-docker.git
30 pushd clearwater-docker
32 for i in base astaire cassandra chronos bono ellis homer homestead ralf sprout
34 sudo docker build -t clearwater/$i $i
37 for i in base astaire cassandra chronos bono ellis homer homestead ralf sprout
39 sudo docker tag clearwater/$i:latest $1/$i:latest
40 sudo docker push $1/$i:latest
46 function setup_k8s() {
47 echo "Preparing the k8s cluster..."
48 python set_depl_files.py $1 $2
52 juju run --application kubeapi-load-balancer 'open-port 5060'
54 juju run --application kubernetes-master 'open-port 30080'
55 juju run --application kubernetes-worker 'open-port 30080'
57 sudo kubectl create -f clearwater-docker/kubernetes
61 cp set_depl_files.py /tmp/
64 juju run --application kubeapi-load-balancer 'unit-get public-address'
66 docker_repo="aakashkt"
69 setup_clearwater $docker_repo
70 setup_k8s $docker_repo $load_balancer_ip