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
2bbc356f
Unverified
Commit
2bbc356f
authored
Nov 04, 2019
by
Erik Wilson
Committed by
GitHub
Nov 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1008 from erikwilson/ip6-system-setup
Improve ip6 system setup & utilities
parents
5d342a30
afa9422a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
20 deletions
+14
-20
run.go
pkg/agent/run.go
+1
-4
setup.go
pkg/agent/syssetup/setup.go
+10
-16
download
scripts/download
+3
-0
No files found.
pkg/agent/run.go
View file @
2bbc356f
...
...
@@ -54,10 +54,6 @@ func run(ctx context.Context, cfg cmds.Agent, lb *loadbalancer.LoadBalancer) err
}
}
if
err
:=
syssetup
.
Configure
();
err
!=
nil
{
return
err
}
if
err
:=
tunnel
.
Setup
(
ctx
,
nodeConfig
,
lb
.
Update
);
err
!=
nil
{
return
err
}
...
...
@@ -105,6 +101,7 @@ func Run(ctx context.Context, cfg cmds.Agent) error {
if
err
:=
validate
();
err
!=
nil
{
return
err
}
syssetup
.
Configure
()
if
cfg
.
Rootless
&&
!
cfg
.
RootlessAlreadyUnshared
{
if
err
:=
rootless
.
Rootless
(
cfg
.
DataDir
);
err
!=
nil
{
...
...
pkg/agent/syssetup/setup.go
View file @
2bbc356f
...
...
@@ -8,11 +8,6 @@ import (
"github.com/sirupsen/logrus"
)
var
(
callIPTablesFile
=
"/proc/sys/net/bridge/bridge-nf-call-iptables"
forward
=
"/proc/sys/net/ipv4/ip_forward"
)
func
loadKernelModule
(
moduleName
string
)
{
if
_
,
err
:=
os
.
Stat
(
"/sys/module/"
+
moduleName
);
err
==
nil
{
logrus
.
Infof
(
"module %s was already loaded"
,
moduleName
)
...
...
@@ -24,20 +19,19 @@ func loadKernelModule(moduleName string) {
}
}
func
Configure
()
error
{
loadKernelModule
(
"br_netfilter"
)
if
err
:=
ioutil
.
WriteFile
(
callIPTablesFile
,
[]
byte
(
"1"
),
0640
);
err
!=
nil
{
logrus
.
Warnf
(
"failed to write value 1 at %s: %v"
,
callIPTablesFile
,
err
)
return
nil
}
if
err
:=
ioutil
.
WriteFile
(
forward
,
[]
byte
(
"1"
),
0640
);
err
!=
nil
{
logrus
.
Warnf
(
"failed to write value 1 at %s: %v"
,
forward
,
err
)
return
nil
func
enableSystemControl
(
file
string
)
{
if
err
:=
ioutil
.
WriteFile
(
file
,
[]
byte
(
"1"
),
0640
);
err
!=
nil
{
logrus
.
Warnf
(
"failed to write value 1 at %s: %v"
,
file
,
err
)
}
}
func
Configure
()
{
loadKernelModule
(
"overlay"
)
loadKernelModule
(
"nf_conntrack"
)
loadKernelModule
(
"br_netfilter"
)
return
nil
enableSystemControl
(
"/proc/sys/net/ipv4/ip_forward"
)
enableSystemControl
(
"/proc/sys/net/ipv6/conf/all/forwarding"
)
enableSystemControl
(
"/proc/sys/net/bridge/bridge-nf-call-iptables"
)
enableSystemControl
(
"/proc/sys/net/bridge/bridge-nf-call-ip6tables"
)
}
scripts/download
View file @
2bbc356f
...
...
@@ -12,6 +12,9 @@ mkdir -p ${CHARTS_DIR}
curl
--compressed
-sfL
https://github.com/rancher/k3s-root/releases/download/
${
ROOT_VERSION
}
/k3s-root-
${
ARCH
}
.tar |
tar
xf -
ln
-sf
pigz bin/unpigz
for
target
in
iptables iptables-save iptables-restore ip6tables ip6tables-save ip6tables-restore
;
do
ln
-sf
xtables-legacy-multi bin/
$target
done
mkdir
-p
bin/aux
&&
rm
bin/mount
&&
ln
-sf
../busybox bin/aux/mount
TRAEFIK_FILE
=
traefik-
${
TRAEFIK_VERSION
}
.tgz
...
...
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