summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/scripts/k8s/kubernetes_run.sh
blob: fd9de2e181f0647b849d96f8a07a6f719060f5c4 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash

####################
#    Functions     #
####################

status()
{
  local rc=$1
  if [ ${rc} != 0 ]; then
    echo "[ERR] Failure detected. Aborting !"
    exit 255
  else
    echo "[INFO] Done "
  fi
}

print_header()
{
  header=$*
  echo ""
  echo "-------------------------"
  echo "   ${header}"
  echo "-------------------------"
  echo ""
 }

####################
#      Main        #
####################
clear

####################
# kubectl          #
####################
print_header "Kubelet - Install ..."
sh ./install_kubectl.sh
status $?


####################
# minikube         #
####################
print_header "Minikube - Install ..."
sh ./install_minikube.sh
status $?


####################
# dependencies     #
####################
print_header "Dependency - Install ..."
echo "[INFO]   Install - nsenter"
# Use pre compiled nsenter:
sudo cp bin/nsenter /usr/local/bin/nsenter
sudo cp etc/bash_completion.d/nsenter /etc/bash_completion.d/nsenter

## In order to build the nsenter use the below instructions:
##./build_nsenter_exec.sh
echo "[INFO]   Install - socat"
sudo apt-get install -y socat jq

####################
# helm             #
####################
print_header "Helm - Install ..."
sh ./install_helm.sh
status $? "$action"


####################
# K8s              #
####################
print_header "SDC - Deploy Pods ..."
sh ./deploy_k8s_sdc.sh
status $?