Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Ensure we have the right modules loaded for weave-npc #2819

Merged
merged 2 commits into from
Feb 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/weavenpc-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ NetworkPolicy object updates from the k8s API server:
network policy, containing the IP addresses of all pods in the
namespace whose labels match that selector

IPsets are implemented by the kernel module `xt_set`, without which
weave-npc will not work.

ipset names are generated deterministically from a string
representation of the corresponding label selector. Because ipset
names are limited to 31 characters in length, this is done by taking a
Expand Down Expand Up @@ -94,6 +97,9 @@ The following traffic is NOT affected:
(e.g. kubelet health checks)
* Traffic routed from an application container to the internet

The above mechanism relies on the kernel module `br_netfilter` being
loaded and enabled via `/proc/sys/net/bridge/bridge-nf-call-iptables`.

See these resources for helpful context:

* http://ebtables.netfilter.org/br_fw_ia/br_fw_ia.html
Expand Down
6 changes: 6 additions & 0 deletions prog/weave-kube/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ CONN_LIMIT=${CONN_LIMIT:-30}
# Default for network policy
EXPECT_NPC=${EXPECT_NPC:-1}

# Ensure we have the required modules for NPC
if [ "${EXPECT_NPC}" != "0" ]; then
modprobe br_netfilter

This comment was marked as abuse.

This comment was marked as abuse.

modprobe xt_set
fi

# kube-proxy requires that bridged traffic passes through netfilter
if ! BRIDGE_NF_ENABLED=$(cat /proc/sys/net/bridge/bridge-nf-call-iptables); then
echo "Cannot detect bridge-nf support - network policy and iptables mode kubeproxy may not work reliably" >&2
Expand Down
5 changes: 5 additions & 0 deletions prog/weave-kube/weave-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
mountPath: /host/etc
- name: dbus
mountPath: /host/var/lib/dbus
- name: lib-modules
mountPath: /lib/modules
resources:
requests:
cpu: 10m
Expand Down Expand Up @@ -73,3 +75,6 @@ spec:
- name: dbus
hostPath:
path: /var/lib/dbus
- name: lib-modules
hostPath:
path: /lib/modules