diff --git a/README.md b/README.md index 23c6eb87cf..3e9dfbef6a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/k3s.service b/k3s.service index a43995c606..822ae13bbc 100644 --- a/k3s.service +++ b/k3s.service @@ -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 diff --git a/pkg/agent/syssetup/setup.go b/pkg/agent/syssetup/setup.go index 280289ce73..1bc3c9ece3 100644 --- a/pkg/agent/syssetup/setup.go +++ b/pkg/agent/syssetup/setup.go @@ -2,6 +2,7 @@ package syssetup import ( "io/ioutil" + "os/exec" "github.com/sirupsen/logrus" ) @@ -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) }