forked from pstember/snyk-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·47 lines (36 loc) · 1.48 KB
/
setup.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
#!/bin/bash
shopt -s expand_aliases
alias ktilt='/usr/local/bin/tilt'
exists()
{
type "$1" >/dev/null 2>&1
}
if exists ktilt ; then
echo Tilt is already installed
else
# To install tilt
curl -fsSL https://raw.githubusercontent.com/windmilleng/tilt/master/scripts/install.sh | bash
alias ktilt='/usr/local/bin/tilt'
fi
if exists helm ; then
echo Helm is already installed
else
# To install helm
brew install kubernetes-helm
helm init -wait
fi
helm repo add snyk-charts https://snyk.github.io/kubernetes-monitor/
helm repo update
# Print your token with the following command (for the dashboard)
echo kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-sa | awk '{print $1}')
echo Your token is
echo ====
echo $(kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-sa | awk '{print $1}') | sed -n "/token:/s/token: //p")
echo ====
# To access the dashboard run the following command then go to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/
echo kubectl proxy
echo http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/
# To get snyk up and running
# I couldn't get this to work in Tile because I need a different namespace and couldn't work out how to get it to switch context
# echo helm upgrade --install snyk-monitor snyk-charts/snyk-monitor --namespace snyk-monitor --set clusterName="Production cluster"
ktilt up