Add K8S deployment above Vagrant
[sdc.git] / sdc-os-chef / scripts / k8s / kubernetes_run.sh
1 #!/bin/bash
2
3 ####################
4 #    Functions     #
5 ####################
6
7 status()
8 {
9   local rc=$1
10   if [ ${rc} != 0 ]; then
11     echo "[ERR] Failure detected. Aborting !"
12     exit 255
13   else
14     echo "[INFO] Done "
15   fi
16 }
17
18 print_header()
19 {
20   header=$*
21   echo ""
22   echo "-------------------------"
23   echo "   ${header}"
24   echo "-------------------------"
25   echo ""
26  }
27
28 ####################
29 #      Main        #
30 ####################
31 clear
32
33 ####################
34 # kubectl          #
35 ####################
36 print_header "Kubelet - Install ..."
37 sh ./install_kubectl.sh
38 status $?
39
40
41 ####################
42 # minikube         #
43 ####################
44 print_header "Minikube - Install ..."
45 sh ./install_minikube.sh
46 status $?
47
48
49 ####################
50 # dependencies     #
51 ####################
52 print_header "Dependency - Install ..."
53 echo "[INFO]   Install - nsenter"
54 # Use pre compiled nsenter:
55 sudo cp bin/nsenter /usr/local/bin/nsenter
56 sudo cp etc/bash_completion.d/nsenter /etc/bash_completion.d/nsenter
57
58 ## In order to build the nsenter use the below instructions:
59 ##./build_nsenter_exec.sh
60 echo "[INFO]   Install - socat"
61 sudo apt-get install -y socat jq
62
63 ####################
64 # helm             #
65 ####################
66 print_header "Helm - Install ..."
67 sh ./install_helm.sh
68 status $? "$action"
69
70
71 ####################
72 # K8s              #
73 ####################
74 print_header "SDC - Deploy Pods ..."
75 sh ./deploy_k8s_sdc.sh
76 status $?
77