summaryrefslogtreecommitdiffstats
path: root/ci/k8.sh
blob: 2b901d7e37d672abff325d06e0462d096a4b9d08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -ex

opnfvfeature=$1

juju scp kubernetes-master/0:/home/ubuntu/config ~/joid_config/config

export KUBECONFIG=~/joid_config/config
export KUBERNETES_PROVIDER=local
export KUBE_MASTER_IP=`juju status kubernetes-master --format=yaml | grep public-address | cut -d ":" -f 2 | head -1 | sed "s/^[ \t]*//g"`
export KUBE_MASTER_URL=http://${KUBE_MASTER_IP}:6443

configk8(){
cat <<-EOF
export KUBECONFIG=${KUBECONFIG}
export KUBERNETES_PROVIDER=${KUBERNETES_PROVIDER}
export KUBE_MASTER_IP=${KUBE_MASTER_IP}
export KUBE_MASTER_URL=${KUBE_MASTER_URL}
EOF
}

configk8 > ~/joid_config/k8config

juju run-action kubernetes-worker/0 microbot replicas=3
juju config kubernetes-master enable-dashboard-addons=true || true
juju expose kubernetes-worker || true
juju scp -- -r kubernetes kubernetes-master/0:
juju ssh kubernetes-master/0 "/bin/bash kubernetes/post-install.sh $opnfvfeature"