From 966c8fcdcef8ff87572001b46c98ce940592070f Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Wed, 7 Sep 2022 07:35:51 -0300 Subject: [PATCH] [0.0.1v] Fixes k3s Version on Redeployment --- deploy.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index 08c1713..642da8f 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,13 @@ #!/bin/bash +function check_k3s_installation() { + if [ ! -f /usr/local/bin/k3s ]; then + export INSTALL_K3S_EXEC="--no-deploy traefik"; + curl -sfL https://get.k3s.io | sh -s -; + sudo chmod 644 /etc/rancher/k3s/k3s.yaml; + fi +} + function start_cert_manager { kubectl apply -f ./cert-manager/cert-manager.yaml; @@ -72,9 +80,7 @@ function main { elif [[ $1 == "--staging" || $1 == "-s" ]]; then - export INSTALL_K3S_EXEC="--no-deploy traefik"; - curl -sfL https://get.k3s.io | sh -s -; - sudo chmod 644 /etc/rancher/k3s/k3s.yaml; + check_k3s_installation kubectl apply -f ./nginx-ingress/nginx-ingress.yaml; kubectl wait --namespace ingress-nginx \ @@ -89,9 +95,7 @@ function main { else - export INSTALL_K3S_EXEC="--no-deploy traefik"; - curl -sfL https://get.k3s.io | sh -s -; - sudo chmod 644 /etc/rancher/k3s/k3s.yaml; + check_k3s_installation kubectl apply -f ./nginx-ingress/nginx-ingress.yaml; kubectl wait --namespace ingress-nginx \