-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdeploy-k8s-localhost.sh
executable file
·50 lines (40 loc) · 1.18 KB
/
deploy-k8s-localhost.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash -e
if [ $# -lt 3 ]; then
echo "Usage: deployk8slocalhost.sh <controller> <model> <path-to-k8-bundle>"
exit
fi
controller=$1
model=$2
k8bundle=$3
#JUJU_DEV_FEATURE_FLAGS=caas,developer-mode juju bootstrap --debug localhost $controller
juju add-model $model
profile=$(cat <<'EOF'
name: juju-##MODEL##
config:
boot.autostart: "true"
linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
description: ""
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /dev/null
type: disk
aadisable1:
path: /sys/module/apparmor/parameters/enabled
source: /dev/null
type: disk
EOF
)
echo "$profile" | sed -e "s/##MODEL##/$model/" | lxc profile edit juju-$model
juju deploy $k8bundle
juju config kubernetes-worker proxy-extra-args="proxy-mode=userspace"
#read -p"Press return to watch deployment status, hit ctrl-C when everything's done." x
watch -c juju status --color
juju scp -m "$controller:$model" kubernetes-master/0:config ~/.kube/config
kubectl get all