Merge branch '2.6'

This commit is contained in:
Bryan Boreham committed 2020-01-27 17:51:32 +00:00
commit 6a458d0712
10 files changed
+83 -27

No files matched your search

+1 -1
View File
@@ -1 +1 @@
2.3.0 2.6.2
+1 -1
View File
@@ -25,7 +25,7 @@ ifeq ($(ARCH),amd64)
WEAVEEXEC_DOCKER_ARCH?=x86_64 WEAVEEXEC_DOCKER_ARCH?=x86_64
# The name of the alpine baseimage to use as the base for weave images # The name of the alpine baseimage to use as the base for weave images
ALPINE_BASEIMAGE?=alpine:3.8 ALPINE_BASEIMAGE?=alpine:3.10
# The extension for the made images # The extension for the made images
# Specifying none means for example weaveworks/weave:latest # Specifying none means for example weaveworks/weave:latest
+30
View File
@@ -6,6 +6,34 @@ modprobe_safe() {
modprobe $1 || echo "Ignore the error if \"$1\" is built-in in the kernel" >&2 modprobe $1 || echo "Ignore the error if \"$1\" is built-in in the kernel" >&2
} }
# Setup iptables backend to be legacy or nftable
setup_iptables_backend() {
if [ -n "${IPTABLES_BACKEND}" ]; then
mode=$IPTABLES_BACKEND
else
# auto-detect if iptables backend mode to use if not specified explicitly
num_legacy_lines=$( (iptables-legacy-save || true) 2>/dev/null | grep '^-' | wc -l)
num_nft_lines=$( (iptables-nft-save || true) 2>/dev/null | grep '^-' | wc -l)
if [ "${num_legacy_lines}" -ge 10 ]; then
mode="legacy"
else
if [ "${num_legacy_lines}" -ge "${num_nft_lines}" ]; then
mode="legacy"
else
mode="nft"
fi
fi
fi
if [ $mode = "nft" ]; then
rm /sbin/iptables
rm /sbin/iptables-save
rm /sbin/iptables-restore
ln -s /sbin/iptables-nft /sbin/iptables
ln -s /sbin/iptables-nft-save /sbin/iptables-save
ln -s /sbin/iptables-nft-restore /sbin/iptables-restore
fi
}
# Check whether xt_set actually exists # Check whether xt_set actually exists
xt_set_exists() { xt_set_exists() {
# Clean everything up in advance, in case there's leftovers # Clean everything up in advance, in case there's leftovers
@@ -24,6 +52,8 @@ xt_set_exists() {
[ -z "$NOT_EXIST" ] || (echo "\"xt_set\" does not exist" >&2 && return 1) [ -z "$NOT_EXIST" ] || (echo "\"xt_set\" does not exist" >&2 && return 1)
} }
setup_iptables_backend
# Default if not supplied - same as weave net default # Default if not supplied - same as weave net default
IPALLOC_RANGE=${IPALLOC_RANGE:-10.32.0.0/12} IPALLOC_RANGE=${IPALLOC_RANGE:-10.32.0.0/12}
HTTP_ADDR=${WEAVE_HTTP_ADDR:-127.0.0.1:6784} HTTP_ADDR=${WEAVE_HTTP_ADDR:-127.0.0.1:6784}
@@ -137,7 +137,7 @@ items:
port: 6784 port: 6784
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
@@ -168,7 +168,7 @@ items:
#npc-args #npc-args
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
+2 -2
View File
@@ -117,7 +117,7 @@ items:
port: 6784 port: 6784
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
@@ -144,7 +144,7 @@ items:
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
hostNetwork: true hostNetwork: true
+2 -2
View File
@@ -126,7 +126,7 @@ items:
port: 6784 port: 6784
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
@@ -156,7 +156,7 @@ items:
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
+2 -2
View File
@@ -134,7 +134,7 @@ items:
port: 6784 port: 6784
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
@@ -165,7 +165,7 @@ items:
#npc-args #npc-args
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
+2 -2
View File
@@ -137,7 +137,7 @@ items:
port: 6784 port: 6784
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
@@ -168,7 +168,7 @@ items:
#npc-args #npc-args
resources: resources:
requests: requests:
cpu: 10m cpu: 50m
securityContext: securityContext:
privileged: true privileged: true
volumeMounts: volumeMounts:
+30
View File
@@ -2,5 +2,35 @@
set -e set -e
# Setup iptables backend to be legacy or nftable
setup_iptables_backend() {
if [ -n "${IPTABLES_BACKEND}" ]; then
mode=$IPTABLES_BACKEND
else
# auto-detect if iptables backend mode to use if not specified explicitly
num_legacy_lines=$( (iptables-legacy-save || true) 2>/dev/null | grep '^-' | wc -l)
num_nft_lines=$( (iptables-nft-save || true) 2>/dev/null | grep '^-' | wc -l)
if [ "${num_legacy_lines}" -ge 10 ]; then
mode="legacy"
else
if [ "${num_legacy_lines}" -ge "${num_nft_lines}" ]; then
mode="legacy"
else
mode="nft"
fi
fi
fi
if [ $mode = "nft" ]; then
rm /sbin/iptables
rm /sbin/iptables-save
rm /sbin/iptables-restore
ln -s /sbin/iptables-nft /sbin/iptables
ln -s /sbin/iptables-nft-save /sbin/iptables-save
ln -s /sbin/iptables-nft-restore /sbin/iptables-restore
fi
}
setup_iptables_backend
# Start weave-npc with any flags specified in $EXTRA_ARGS as well as any flags passed to this container (for backwards compatibility) # Start weave-npc with any flags specified in $EXTRA_ARGS as well as any flags passed to this container (for backwards compatibility)
exec /usr/bin/weave-npc $EXTRA_ARGS $@ exec /usr/bin/weave-npc $EXTRA_ARGS $@
+11 -15
View File
@@ -89,23 +89,18 @@ Kubernetes manages
on each node, and only schedules pods to run on nodes that have enough on each node, and only schedules pods to run on nodes that have enough
free resources. free resources.
The components of a typical Kubernetes installation (with the master In the example manifests we request 10% of a CPU, which will be enough
node running etcd, scheduler, api-server, etc.) take up about 95% of a for small installations, but you should monitor how much it uses in
CPU, which leaves little room to run anything else. For all of Weave your production clusters and adjust the requests to suit.
Net's features to work, it must run on every node, including the
master.
The best way to resolve this issue is to use machines with at least We do not recommend that you set a CPU or memory _limit_ unless you
two CPU cores. However if you are installing Kubernetes and Weave Net are very experienced in such matters, because the implementation of
for the first time, you may not be aware of this requirement. For this limits in the Linux kernel sometimes behaves in a surprising way.
reason, Weave Net launches as a DaemonSet with a specification that
reserves at least 1% CPU for each container. This enables Weave Net to
start up seamlessly on a single-CPU node.
Depending on the workload, Weave Net may need more than 1% of the On a 1-node single-CPU cluster you may find Weave Net does not install
CPU. The percentage set in the DaemonSet is the minimum and not a at all, because other Kubernetes components already take 95% of the
limit. This minimum setting allows Weave Net to take advantage of CPU. The best way to resolve this issue is to use machines with at
available CPU and "burst" above that limit if it needs to. least two CPU cores.
## <a name="eviction"></a>Pod Eviction ## <a name="eviction"></a>Pod Eviction
@@ -411,6 +406,7 @@ The list of variables you can set is:
* `NO_MASQ_LOCAL` - set to 1 to preserve the client source IP address when * `NO_MASQ_LOCAL` - set to 1 to preserve the client source IP address when
accessing Service annotated with `service.spec.externalTrafficPolicy=Local`. accessing Service annotated with `service.spec.externalTrafficPolicy=Local`.
The feature works only with Weave IPAM (default). The feature works only with Weave IPAM (default).
* `IPTABLES_BACKEND` - set to `nft` to use `nftables` backend for `iptables` (default is `iptables`)
Example: Example:
``` ```