Browse Source

Ensure that br_netfilter module is loaded

pull/14/head
Darren Shepherd 6 years ago
parent
commit
3f2a951564
  1. 1
      README.md
  2. 1
      k3s.service
  3. 2
      pkg/agent/syssetup/setup.go

1
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

1
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

2
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)
}

Loading…
Cancel
Save