mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Merge pull request #371 from warmchang/nf_conntrack
🔧 modprobe nf_conntrack
This commit is contained in:
commit
2950e81c23
@ -80,7 +80,7 @@ flag
|
|||||||
At this point, you can run the agent as a separate process or not run it on this node at all.
|
At this point, you can run the agent as a separate process or not run it on this node at all.
|
||||||
|
|
||||||
If you encounter an error like `"stream server error: listen tcp: lookup some-host on X.X.X.X:53: no such host"`
|
If you encounter an error like `"stream server error: listen tcp: lookup some-host on X.X.X.X:53: no such host"`
|
||||||
when starting k3s please ensure `/etc/hosts` contains your current hostname (output of `hostname`),
|
when starting k3s please ensure `/etc/hosts` contains your current hostname (output of `hostname`),
|
||||||
set to a 127.x.x.x address. For example:
|
set to a 127.x.x.x address. For example:
|
||||||
```
|
```
|
||||||
127.0.1.1 myhost
|
127.0.1.1 myhost
|
||||||
@ -267,8 +267,6 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
EnvironmentFile=/etc/systemd/system/k3s.service.env
|
EnvironmentFile=/etc/systemd/system/k3s.service.env
|
||||||
ExecStartPre=-/sbin/modprobe br_netfilter
|
|
||||||
ExecStartPre=-/sbin/modprobe overlay
|
|
||||||
ExecStart=/usr/local/bin/k3s server
|
ExecStart=/usr/local/bin/k3s server
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
|
@ -4,8 +4,8 @@ Documentation=https://k3s.io
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=-/sbin/modprobe br_netfilter
|
Type=notify
|
||||||
ExecStartPre=-/sbin/modprobe overlay
|
EnvironmentFile=/etc/systemd/system/k3s.service.env
|
||||||
ExecStart=/usr/local/bin/k3s server
|
ExecStart=/usr/local/bin/k3s server
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
|
@ -13,12 +13,26 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Configure() error {
|
func Configure() error {
|
||||||
exec.Command("modprobe", "br_netfilter").Run()
|
if err := exec.Command("modprobe", "br_netfilter").Run(); err != nil {
|
||||||
|
logrus.Warnf("failed to start br_netfilter module")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if err := ioutil.WriteFile(callIPTablesFile, []byte("1"), 0640); err != nil {
|
if err := ioutil.WriteFile(callIPTablesFile, []byte("1"), 0640); err != nil {
|
||||||
logrus.Warnf("failed to write value 1 at %s: %v", callIPTablesFile, err)
|
logrus.Warnf("failed to write value 1 at %s: %v", callIPTablesFile, err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
if err := ioutil.WriteFile(forward, []byte("1"), 0640); err != nil {
|
if err := ioutil.WriteFile(forward, []byte("1"), 0640); err != nil {
|
||||||
logrus.Warnf("failed to write value 1 at %s: %v", forward, err)
|
logrus.Warnf("failed to write value 1 at %s: %v", forward, err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := exec.Command("modprobe", "overlay").Run(); err != nil {
|
||||||
|
logrus.Warnf("failed to start overlay module")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if err := exec.Command("modprobe", "nf_conntrack").Run(); err != nil {
|
||||||
|
logrus.Warnf("failed to start nf_conntrack module")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user