Update k3s.sh

This commit is contained in:
2025-05-27 01:01:56 +08:00
parent a050b0f0f4
commit 42a0b6f3ef

16
k3s.sh
View File

@@ -125,19 +125,17 @@ echo 'complete -o default -F __start_kubectl k' >> /root/.bashrc
# Install git for Helm plugins
apt-get install -y git
# Install Helm
# Fixed Helm installation: manual download and extraction
echo "Installing Helm manually..."
HELM_VERSION="v3.18.0"
cd /tmp
curl -fsSL https://get.helm.sh/helm-v3.18.0-linux-amd64.tar.gz -o helm.tar.gz
tar -zxvf helm.tar.gz
curl -LO "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -zxvf "helm-${HELM_VERSION}-linux-amd64.tar.gz"
mv linux-amd64/helm /usr/local/bin/helm
chmod +x /usr/local/bin/helm
rm -rf linux-amd64 "helm-${HELM_VERSION}-linux-amd64.tar.gz"
# Verify Helm
if ! command -v helm >/dev/null 2>&1; then
echo " Helm installation failed. Check PATH."
exit 1
fi
# Verify Helm installation
helm version
# Add Ingress-NGINX via Helm
kubectl create namespace ingress-nginx