mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
commit
63b81d3399
@ -3,6 +3,8 @@ set -e
|
||||
|
||||
cd $(dirname $0)/..
|
||||
|
||||
. ./scripts/setup-rancher-path.sh
|
||||
|
||||
# Prime sudo
|
||||
sudo echo Compiling
|
||||
|
||||
@ -15,4 +17,4 @@ else
|
||||
fi
|
||||
|
||||
echo Starting agent
|
||||
sudo env "PATH=$(pwd)/bin:$PATH" ./bin/k3s-agent --debug agent -s https://localhost:6443 -t $(<${HOME}/.rancher/k3s/server/node-token) "$@"
|
||||
sudo env "PATH=$(pwd)/bin:$PATH" ./bin/k3s-agent --debug agent -s https://localhost:6443 -t $(<${RANCHER_PATH}/k3s/server/node-token) "$@"
|
||||
|
@ -1,6 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd $(dirname $0)/..
|
||||
|
||||
. ./scripts/setup-rancher-path.sh
|
||||
|
||||
IP=$(ip addr show dev docker0 | grep -w inet | awk '{print $2}' | cut -f1 -d/)
|
||||
docker run \
|
||||
--read-only \
|
||||
@ -16,4 +20,4 @@ docker run \
|
||||
-v /var/lib/cni \
|
||||
-v /usr/lib/x86_64-linux-gnu/libsqlite3.so.0:/usr/lib/x86_64-linux-gnu/libsqlite3.so.0:ro \
|
||||
--privileged \
|
||||
ubuntu:18.04 /usr/bin/k3s-agent agent -t $(<~/.rancher/k3s/server/node-token) -s https://${IP}:6443
|
||||
ubuntu:18.04 /usr/bin/k3s-agent agent -t $(<${RANCHER_PATH}/k3s/server/node-token) -s https://${IP}:6443
|
||||
|
7
scripts/setup-rancher-path.sh
Executable file
7
scripts/setup-rancher-path.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
RANCHER_PATH="/var/lib/rancher"
|
||||
else
|
||||
RANCHER_PATH="$HOME/.rancher"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user