From ded39399d347d633eedce095abec778386114acf Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Mon, 29 May 2023 19:38:05 +0800 Subject: [PATCH] setup-k3s.sh: fixed setup_helm with error --- playbook/roles/k3s/files/setup-k3s.sh | 34 +++++++++++---------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/playbook/roles/k3s/files/setup-k3s.sh b/playbook/roles/k3s/files/setup-k3s.sh index 546a49e1..92e25d88 100644 --- a/playbook/roles/k3s/files/setup-k3s.sh +++ b/playbook/roles/k3s/files/setup-k3s.sh @@ -64,24 +64,6 @@ function set_k3s_cni_kubevon() --data-dir=/opt/rancher/k3s \ --kube-apiserver-arg service-node-port-range=0-50000 fi - -} - -funtion setup_helm() -{ - export KUBECONFIG=/etc/rancher/k3s/k3s.yaml - case `uname -m` in - x86_64) ARCH=amd64; ;; - aarch64) ARCH=arm64; ;; - loongarch64) ARCH=loongarch64; ;; - *) echo "un-supported arch, exit ..."; exit 1; ;; - esac - rm -rf helm.tar.gz* /usr/local/bin/helm || echo true - sudo wget --no-check-certificate https://mirrors.onwalk.net/tools/linux-${ARCH}/helm.tar.gz && sudo tar -xvpf helm.tar.gz -C /usr/local/bin/ - sudo chmod 755 /usr/local/bin/helm - - helm repo add artifact https://artifact.onwalk.net/chartrepo/public/ | echo true - helm repo up } ## __main__ ## @@ -91,5 +73,17 @@ if [[ $cni == 'default' ]]; then elif [[ $cni == 'kubeovn' ]]; then set_k3s_cni_kubevon fi - setup_helm -# end + +export KUBECONFIG=/etc/rancher/k3s/k3s.yaml +case `uname -m` in + x86_64) ARCH=amd64; ;; + aarch64) ARCH=arm64; ;; + loongarch64) ARCH=loongarch64; ;; + *) echo "un-supported arch, exit ..."; exit 1; ;; +esac +rm -rf helm.tar.gz* /usr/local/bin/helm || echo true +sudo wget --no-check-certificate https://mirrors.onwalk.net/tools/linux-${ARCH}/helm.tar.gz && sudo tar -xvpf helm.tar.gz -C /usr/local/bin/ +sudo chmod 755 /usr/local/bin/helm + +helm repo add artifact https://artifact.onwalk.net/chartrepo/public/ | echo true +helm repo up