From 3f2a951564ce13ef11cfd825dbfc2eabf962c809 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 25 Jan 2019 21:52:29 -0700 Subject: [PATCH] Ensure that br_netfilter module is loaded --- README.md | 1 + k3s.service | 1 + pkg/agent/syssetup/setup.go | 2 ++ 3 files changed, 4 insertions(+) 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) }