Skip to content

Commit

Permalink
Ensure that br_netfilter module is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jan 26, 2019
1 parent ce93f17 commit 3f2a951
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Documentation=https://k3s.io
After=network.target

[Service]
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server
KillMode=process
Expand Down
1 change: 1 addition & 0 deletions k3s.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Documentation=https://k3s.io
After=network.target

[Service]
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server
KillMode=process
Expand Down
2 changes: 2 additions & 0 deletions pkg/agent/syssetup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package syssetup

import (
"io/ioutil"
"os/exec"

"github.com/sirupsen/logrus"
)
Expand All @@ -11,6 +12,7 @@ var (
)

func Configure() error {
exec.Command("modprobe", "br_netfilter").Run()
if err := ioutil.WriteFile(callIPTablesFile, []byte("1"), 0640); err != nil {
logrus.Warnf("failed to write value 1 at %s: %v", callIPTablesFile, err)
}
Expand Down

0 comments on commit 3f2a951

Please sign in to comment.