fix run of whitespaces, shfmt, indentations

This commit is contained in:
Ira Abramov 2024-04-04 16:06:12 +03:00
parent 39883fa083
commit 50c7274c95
1 changed files with 42 additions and 41 deletions

11
Kubernetes/RKE2/rke2.sh Normal file → Executable file
View File

@ -15,7 +15,6 @@ echo -e " \033[36;5m \
echo -e " \033[32;5m https://youtube.com/@jims-garage \033[0m"
echo -e " \033[32;5m \033[0m"
#############################################
# YOU SHOULD ONLY NEED TO EDIT THIS SECTION #
#############################################
@ -77,8 +76,7 @@ chmod 600 /home/$user/.ssh/$certName
chmod 644 /home/$user/.ssh/$certName.pub
# Install Kubectl if not already present
if ! command -v kubectl version &> /dev/null
then
if ! command -v kubectl version &>/dev/null; then
echo -e " \033[31;5mKubectl not found, installing\033[0m"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
@ -126,7 +124,10 @@ echo " - rke2-ingress-nginx" >> config.yaml
sudo cp ~/config.yaml /etc/rancher/rke2/config.yaml
# update path with rke2-binaries
echo 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml' >> ~/.bashrc ; echo 'export PATH=${PATH}:/var/lib/rancher/rke2/bin' >> ~/.bashrc ; echo 'alias k=kubectl' >> ~/.bashrc ; source ~/.bashrc ;
echo 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml' >>~/.bashrc
echo 'export PATH=${PATH}:/var/lib/rancher/rke2/bin' >>~/.bashrc
echo 'alias k=kubectl' >>~/.bashrc
source ~/.bashrc
# Step 2: Copy kube-vip.yaml and certs to all masters
for newnode in "${allmasters[@]}"; do
@ -155,7 +156,7 @@ EOF
echo -e " \033[32;5mMaster1 Completed\033[0m"
# Step 4: Set variable to the token we just extracted, set kube config location
token=`cat token`
token=$(cat token)
sudo cat ~/.kube/rke2.yaml | sed 's/127.0.0.1/'$master1'/g' >$HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=${HOME}/.kube/config