Skip to content

Commit be68210

Browse files
committed
refactor(k3s): relocate and update k3s installation script
Moved install-k3s.sh from tests/k3s to scripts directory * Updated install-k3s.sh script to set KUBECONFIG directly to /etc/rancher/k3s/k3s.yaml Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
1 parent d991b5c commit be68210

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ tests/collect-debug-logs:
7171

7272
.PHONY: install-k3s, build-and-push-images
7373
install-k3s:
74-
./tests/k3s/install-k3s.sh
74+
./scripts/install-k3s.sh
7575
build-and-push-images:
7676
./tests/k3s/build-and-push-images.sh
7777

tests/k3s/install-k3s.sh renamed to scripts/install-k3s.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ set -euo pipefail
77
# We will just need to make sure that containerd-shim-spin-v2 binary is in PATH
88
# and that the k3s service is running.
99

10-
curl -sfL https://get.k3s.io | sh -
10+
curl -sfL https://get.k3s.io | sh -s - server --write-kubeconfig-mode '0644'
1111
sudo systemctl start k3s
12-
sudo k3s kubectl get nodes
1312

14-
sudo chmod 644 /etc/rancher/k3s/k3s.yaml
15-
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/k3s.yaml
16-
export KUBECONFIG=$HOME/.kube/k3s.yaml
13+
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
1714
kubectl get nodes

0 commit comments

Comments
 (0)