From 2f347a468ef840c82e54a3860ac5745d1fcda563 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 24 Mar 2023 10:05:37 +0800 Subject: [PATCH] roles/k3s/files: update --- playbook/roles/k3s/files/setup-dns-provider.sh | 9 ++++----- .../roles/k3s/files/setup-ingress-with-nodePort.sh | 12 ++++++------ .../roles/k3s/files/setup-k3s-with-hostpath-sc.sh | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/playbook/roles/k3s/files/setup-dns-provider.sh b/playbook/roles/k3s/files/setup-dns-provider.sh index fd95c62c..af469aaf 100644 --- a/playbook/roles/k3s/files/setup-dns-provider.sh +++ b/playbook/roles/k3s/files/setup-dns-provider.sh @@ -19,8 +19,7 @@ alibabacloud: zoneType: public EOF -export KUBECONFIG=/etc/rancher/k3s/k3s.yaml -sudo helm repo add bitnami https://charts.bitnami.com/bitnami || echo true -sudo helm repo update -sudo kubectl create namespace external-dns || echo true -sudo helm upgrade --install external-dns -f external-dns-values.yaml bitnami/external-dns -n external-dns +helm repo add bitnami https://charts.bitnami.com/bitnami || echo true +helm repo update +kubectl create namespace external-dns || echo true +helm upgrade --install external-dns -f external-dns-values.yaml bitnami/external-dns -n external-dns diff --git a/playbook/roles/k3s/files/setup-ingress-with-nodePort.sh b/playbook/roles/k3s/files/setup-ingress-with-nodePort.sh index caf30111..d360e3f2 100644 --- a/playbook/roles/k3s/files/setup-ingress-with-nodePort.sh +++ b/playbook/roles/k3s/files/setup-ingress-with-nodePort.sh @@ -41,9 +41,9 @@ spec: targetPort: 443 EOF -sudo helm repo add nginx-stable https://helm.nginx.com/stable || echo true -sudo helm repo up -sudo kubectl create namespace ingress || echo true -sudo helm upgrade --install nginx nginx-stable/nginx-ingress --version=0.15.0 --namespace ingress -f value.yaml -sudo kubectl apply -f nginx-cm.yaml -sudo kubectl patch svc nginx-nginx-ingress -n ingress --patch-file nginx-svc-patch.yaml +helm repo add nginx-stable https://helm.nginx.com/stable || echo true +helm repo up +kubectl create namespace ingress || echo true +helm upgrade --install nginx nginx-stable/nginx-ingress --version=0.15.0 --namespace ingress -f value.yaml +kubectl apply -f nginx-cm.yaml +kubectl patch svc nginx-nginx-ingress -n ingress --patch-file nginx-svc-patch.yaml diff --git a/playbook/roles/k3s/files/setup-k3s-with-hostpath-sc.sh b/playbook/roles/k3s/files/setup-k3s-with-hostpath-sc.sh index 42d28fac..4634b667 100644 --- a/playbook/roles/k3s/files/setup-k3s-with-hostpath-sc.sh +++ b/playbook/roles/k3s/files/setup-k3s-with-hostpath-sc.sh @@ -6,8 +6,8 @@ curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.24.7+k3s1 sh -s - \ --data-dir=/opt/rancher/k3s \ --kube-apiserver-arg service-node-port-range=0-50000 -#export KUBECONFIG=/etc/rancher/k3s/k3s.yaml +export KUBECONFIG=/etc/rancher/k3s/k3s.yaml sudo wget --no-check-certificate https://mirrors.onwalk.net/tools/linux-amd64/helm.tar.gz && sudo tar -xvpf helm.tar.gz -C /usr/local/bin/ sudo chmod 755 /usr/local/bin/helm -sudo helm repo add artifact https://artifact.onwalk.net/chartrepo/k8s/ | echo true -sudo helm repo up +helm repo add artifact https://artifact.onwalk.net/chartrepo/k8s/ | echo true +helm repo up