Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d7e5c860
Commit
d7e5c860
authored
Mar 06, 2019
by
David Pendray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix node-token path not resolving for root user in agent scripts
parent
10be950d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
dev-agent.sh
scripts/dev-agent.sh
+3
-1
dev-docker-agent.sh
scripts/dev-docker-agent.sh
+3
-1
setup-rancher-path.sh
scripts/setup-rancher-path.sh
+7
-0
No files found.
scripts/dev-agent.sh
View file @
d7e5c860
#!/bin/bash
set
-e
.
setup-rancher-path.sh
cd
$(
dirname
$0
)
/..
# Prime sudo
...
...
@@ -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
)
"
$@
"
scripts/dev-docker-agent.sh
View file @
d7e5c860
#!/bin/bash
.
setup-rancher-path.sh
cd
$(
dirname
$0
)
/..
IP
=
$(
ip addr show dev docker0 |
grep
-w
inet |
awk
'{print $2}'
|
cut
-f1
-d
/
)
docker run
\
...
...
@@ -16,4 +18,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
scripts/setup-rancher-path.sh
0 → 100755
View file @
d7e5c860
#!/bin/bash
if
[
$(
id
-u
)
=
0
]
;
then
RANCHER_PATH
=
"/var/lib/rancher"
else
RANCHER_PATH
=
"
$HOME
/.rancher"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment