-
Notifications
You must be signed in to change notification settings - Fork 37
/
install_tools.sh
39 lines (32 loc) · 1.27 KB
/
install_tools.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
#!/bin/bash/
set -o nounset
##################################################################
# Bash script to install kubectl, kubectx, kubens and gcloud SDK #
##################################################################
## Linux/Mac ##
cd /tmp/
## kubectl
echo '###Installing kubectl..'
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x /tmp/kubectl && \
sudo mv /tmp/kubectl /usr/local/bin/kubectl
###Clone https://github.com/ahmetb/kubectx.. containe kubectx and kubens
sudo git clone https://github.com/ahmetb/kubectx /opt/kubectx
if $? != 0; then
echo "ERROR: cloning https://github.com/ahmetb/kubectx failed ..."
exit
fi
## kubectx
echo '###Installing kubectx..'
chmod +x /opt/kubectx/kubectx && \
sudo mv /opt/kubectx/kubectx /usr/local/bin/kubectx
echo "source /opt/kubectx/completion/kubectx.bash" >> ~/.bashrc
## kubens
echo '###Installing kubens..'
chmod +x /opt/kubectx/kubens && \
sudo mv /opt/kubectx/kubens /usr/local/bin/kubens
echo "source /opt/kubectx/completion/kubens.bash" >> ~/.bashrc
## SDK Google
echo '###Installing SDK Google Cloud..'
curl https://sdk.cloud.google.com > install.sh && \
bash install.sh --disable-prompts