Compare commits

...
30 Commits
Author SHA1 Message Date
Murali Reddy 57bca8e955 Add release v2.6.1 2020-03-06 18:36:33 +05:30
Bryan Boreham 709f820ab6 Merge pull request #3763 from weaveworks/no-lock-round-send
Move send of ipsec message outside lock
2020-03-05 10:21:18 +00:00
Bryan Boreham 599b99a6c4 Merge pull request #3770 from weaveworks/fix-manifests
fix weave-kube manifests
2020-02-26 11:37:01 +00:00
Bryan Boreham bb51a4f36d Merge pull request #3766 from weaveworks/static-ips-doc
Note different ways to ask for static IPs
2020-02-14 09:31:13 +00:00
Murali Reddy 5d0e44bb6f add missing dnsPolicy: ClusterFirstWithHostNet in weave-daemonset-k8s-1.11.yaml
update apiVersion from rbac.authorization.k8s.io/v1beta1 to rbac.authorization.k8s.io/v1
2020-02-11 13:15:33 +05:30
Bryan Boreham 6e7a469a62 Note different ways to ask for static IPs 2020-02-05 09:57:12 +00:00
Bryan Boreham ca0498b860 Fix warning log to use formatted variant 2020-01-28 15:15:28 +00:00
Bryan Boreham bbfa682083 Move send of ipsec message outside lock
The send may block, so do all changes to the forwarder object and
release the lock before attempting to send.
2020-01-28 15:13:33 +00:00
Bryan Boreham f763c40c10 Update connection limit in docs 2020-01-28 12:53:14 +00:00
Bryan Boreham 67037b43b0 Merge pull request #3760 from weaveworks/update-ruby-262
Update Ruby version for Netlify build
2020-01-27 17:46:51 +00:00
Bryan Boreham 861395011c Update Ruby version for the benefit of Netlify build
Picked 2.6.2 based on message from Netlify build:
"Included versions: 2.3.6 2.5.4 2.4.5 2.4.3 2.2.9 2.6.2"
2020-01-27 17:05:46 +00:00
Bryan Boreham 8bdfcd3042 Merge pull request #3747 from weaveworks/iptables1.8
support Iptables 1.8 with legacy and nf_tables support
2020-01-08 10:46:41 +00:00
Murali Reddy 83024b946f use softlinks to link iptables to backend specific commands and update docs 2020-01-08 15:44:22 +05:30
Murali Reddy 4f48670345 set iptables backend to use if specified explicitly or auto-detect 2020-01-08 15:44:10 +05:30
Murali Reddy 4b30d97d4e update alpine base image to 3.10 that has iptables ver 1.8.3 2020-01-08 15:43:51 +05:30
Bryan Boreham c9e813cfcb Merge pull request #3740 from weaveworks/raise-cpu-requests
Raise Kubernetes CPU requests from 10m to 50m
2019-12-13 12:27:24 +00:00
Bryan Boreham c97c50b76e Merge pull request #3735 from weaveworks/release-script-add-k11
Add weave-daemonset-k8s-1.11.yaml to release script
2019-12-13 11:37:09 +00:00
Bryan Boreham f919d06e2c Merge pull request #3745 from AlejoAsd/fix/site-kube-addon-md-link-fix
Fix kube-addon documentation broken markdown link
2019-12-13 11:32:47 +00:00
Bryan Boreham 526538d9d1 Merge branch 'master' into 2.6 2019-12-07 11:55:16 +00:00
Bryan Boreham f43f3fc2e8 Merge pull request #3744 from weaveworks/issue-3741
upgrade to newer terraform that is compatible with google cloud API
2019-12-07 11:54:47 +00:00
Alejo Carballude 8b220f6383 Fix kube-addon documentation broken markdown link. 2019-12-06 16:00:03 -03:00
Murali Reddy d44e34584a Update tools submodule to latest commit 2a2df527894bcaa5d42ad80654c43e1e5a6b03d7 2019-12-06 18:48:49 +05:30
Murali Reddy 6d2366ca4c upgrade to newer terraform that is compatible with google cloud API
Fixes #3741
2019-12-06 10:19:27 +05:30
Bryan Boreham 7c1b615c98 Add a note about dropping CAP_NET_RAW in Kubernetes 2019-12-04 21:04:55 +00:00
Bryan Boreham 390a4099d0 Merge branch '2.6' 2019-11-28 20:47:39 +00:00
Bryan Boreham 01237446eb Update docs to match new memory requests 2019-11-22 23:23:55 +00:00
Bryan Boreham 18deb42df1 Raise Kubernetes CPU requests from 10m to 50m
This setting is passed by Kubelet to the Linux scheduler to ask for a share of
available CPU, so we should ask for a bit more than 1% of 1 CPU. Otherwise if a
CPU is contended Weave Net will get throttled frequently.

Weave Net in fastdp mode shouldn't need a lot of CPU most of the time, but at
startup there is quite a lot to do.

The setting is also used by the Kubernetes scheduler to decide how much will fit
on a node, so setting it much higher will reserve CPU that we shouldn't need most
of the time.
2019-11-22 22:30:03 +00:00
Bryan Boreham 5c508f837e Add manifest for Kubernetes 1.11 and above 2019-11-11 10:15:53 +00:00
Bryan Boreham e000472af7 Release 2.6 2019-11-05 19:40:45 +00:00
Bryan Boreham 6d70284c21 Increase default connection limit to 200
Improvements in resource consumption in larger clusters mean we can
raise this limit.
2019-11-05 19:40:45 +00:00
18 changed files with 180 additions and 65 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
2.3.0
2.6.2
+16
View File
@@ -1,3 +1,19 @@
## Release 2.6.1
This release fixes a bug discovered since the release of Weave Net 2.6.0 and
an improvement to support iptables 1.8
### Bug fixes
* Weave Net on node restart unable to form connections to peers and connections get stuck in
pending state and stops responding to API endpoint #3762 #3763
### Other improvements
* Weave Net Kubernetes images by default uses iptables 1.8 with legacy (netfilter) backend with
option to choose netfilter as backend #3465, #3747
## Release 2.6.0
This release reduces CPU and memory usage in larger clusters, by
+1 -1
View File
@@ -25,7 +25,7 @@ ifeq ($(ARCH),amd64)
WEAVEEXEC_DOCKER_ARCH?=x86_64
# 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
# Specifying none means for example weaveworks/weave:latest
+1 -1
View File
@@ -10,7 +10,7 @@ function signal_failure() {
trap signal_failure ERR
function install_terraform() {
curl -fsS https://releases.hashicorp.com/terraform/0.8.5/terraform_0.8.5_linux_amd64.zip | gunzip >terraform && chmod +x terraform && sudo mv terraform /usr/bin
curl -fsS https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip | gunzip >terraform && chmod +x terraform && sudo mv terraform /usr/bin
}
function install_ansible() {
+15
View File
@@ -93,6 +93,7 @@ build() {
sed -i.bak -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset-k8s-1.7.yaml
sed -i.bak -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset-k8s-1.8.yaml
sed -i.bak -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset-k8s-1.9.yaml
sed -i.bak -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset-k8s-1.11.yaml
make SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER
if make tests; then
@@ -189,6 +190,13 @@ draft() {
--name "weave-daemonset-k8s-1.9.yaml" \
--file "./prog/weave-kube/weave-daemonset-k8s-1.9.yaml"
github-release upload \
--user $GITHUB_USER \
--repo weave \
--tag $LATEST_TAG \
--name "weave-daemonset-k8s-1.11.yaml" \
--file "./prog/weave-kube/weave-daemonset-k8s-1.11.yaml"
echo "** Draft $TYPE $RELEASE_NAME $VERSION created at"
echo -e "\thttps://github.com/$GITHUB_USER/weave/releases/$LATEST_TAG"
}
@@ -304,6 +312,13 @@ publish() {
--name "weave-daemonset-k8s-1.9.yaml" \
--file "./prog/weave-kube/weave-daemonset-k8s-1.9.yaml"
github-release upload \
--user $GITHUB_USER \
--repo weave \
--tag latest_release \
--name "weave-daemonset-k8s-1.11.yaml" \
--file "./prog/weave-kube/weave-daemonset-k8s-1.11.yaml"
echo "** Release $RELEASE_NAME $VERSION published at"
echo -e "\thttps://github.com/$GITHUB_USER/weave/releases/$LATEST_TAG"
echo -e "\thttps://github.com/$GITHUB_USER/weave/releases/latest_release"
+9 -13
View File
@@ -85,7 +85,7 @@ func New(log *logrus.Logger) (*IPSec, error) {
// InitSALocal initializes inbound ipsec from remotePeer and triggers
// the initialization on remotePeer.
func (ipsec *IPSec) InitSALocal(localPeer, remotePeer mesh.PeerName, connUID uint64, localIP, remoteIP net.IP, udpPort int, sessionKey *[32]byte, initRemote func([]byte) error) error {
func (ipsec *IPSec) InitSALocal(localPeer, remotePeer mesh.PeerName, connUID uint64, localIP, remoteIP net.IP, udpPort int, sessionKey *[32]byte) ([]byte, error) {
// ID of inbound SPI
spiID := getSPIId(remotePeer, localPeer, connUID)
@@ -95,17 +95,17 @@ func (ipsec *IPSec) InitSALocal(localPeer, remotePeer mesh.PeerName, connUID uin
// Derive SA key
nonce, err := genNonce()
if err != nil {
return errors.Wrap(err, "generate nonce")
return nil, errors.Wrap(err, "generate nonce")
}
key, err := deriveKey(sessionKey[:], nonce, localPeer)
if err != nil {
return errors.Wrap(err, "derive key")
return nil, errors.Wrap(err, "derive key")
}
// Allocate SA
sa, err := netlink.XfrmStateAllocSpi(xfrmAllocSpiState(remoteIP, localIP))
if err != nil {
return errors.Wrap(err, fmt.Sprintf("ip xfrm state allocspi (in, %s, %s)", remoteIP, localIP))
return nil, errors.Wrap(err, fmt.Sprintf("ip xfrm state allocspi (in, %s, %s)", remoteIP, localIP))
}
// Use SPI generated by the kernel. The kernel ensures {dstIP, spi} to
@@ -117,28 +117,24 @@ func (ipsec *IPSec) InitSALocal(localPeer, remotePeer mesh.PeerName, connUID uin
// Create SA
if sa, err := xfrmState(remoteIP, localIP, spi, false, key); err == nil {
if err := netlink.XfrmStateUpdate(sa); err != nil {
return errors.Wrap(err, fmt.Sprintf("xfrm state update (in, %s, %s, 0x%x)", sa.Src, sa.Dst, sa.Spi))
return nil, errors.Wrap(err, fmt.Sprintf("xfrm state update (in, %s, %s, 0x%x)", sa.Src, sa.Dst, sa.Spi))
}
} else {
return errors.Wrap(err, "new xfrm state (in)")
return nil, errors.Wrap(err, "new xfrm state (in)")
}
// Install iptables rules
if err := ipsec.installDropNonEncrypted(localIP, remoteIP, udpPort, spi); err != nil {
return errors.Wrap(err, fmt.Sprintf("install protecting rules (%s, %s, %d, 0x%x)", localIP, remoteIP, udpPort, spi))
return nil, errors.Wrap(err, fmt.Sprintf("install protecting rules (%s, %s, %d, 0x%x)", localIP, remoteIP, udpPort, spi))
}
si := spiInfo{spi: spi, isDirOut: false}
ipsec.spiInfo[spiID] = si
ipsec.spis[spi] = &si
// Trigger the initialization on the remote peer
// Generate the message to trigger initialization on the remote peer
msg := &msgInitSARemote{nonce, spi}
if err := initRemote(msg.serialize()); err != nil {
return errors.Wrap(err, "send InitSARemote")
}
return nil
return msg.serialize(), nil
}
// InitSARemote initializes outbound ipsec to remotePeer.
+30
View File
@@ -6,6 +6,34 @@ modprobe_safe() {
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
xt_set_exists() {
# 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)
}
setup_iptables_backend
# Default if not supplied - same as weave net default
IPALLOC_RANGE=${IPALLOC_RANGE:-10.32.0.0/12}
HTTP_ADDR=${WEAVE_HTTP_ADDR:-127.0.0.1:6784}
@@ -8,7 +8,7 @@ items:
labels:
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: weave-net
@@ -48,7 +48,7 @@ items:
verbs:
- patch
- update
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: weave-net
@@ -62,7 +62,7 @@ items:
- kind: ServiceAccount
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: weave-net
@@ -85,7 +85,7 @@ items:
- configmaps
verbs:
- create
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: weave-net
@@ -137,7 +137,7 @@ items:
port: 6784
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
@@ -168,7 +168,7 @@ items:
#npc-args
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
@@ -176,6 +176,7 @@ items:
mountPath: /run/xtables.lock
readOnly: false
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
hostPID: true
restartPolicy: Always
securityContext:
+2 -2
View File
@@ -117,7 +117,7 @@ items:
port: 6784
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
@@ -144,7 +144,7 @@ items:
imagePullPolicy: Always
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
hostNetwork: true
+2 -2
View File
@@ -126,7 +126,7 @@ items:
port: 6784
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
@@ -156,7 +156,7 @@ items:
imagePullPolicy: Always
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
+6 -6
View File
@@ -8,7 +8,7 @@ items:
labels:
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: weave-net
@@ -48,7 +48,7 @@ items:
verbs:
- patch
- update
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: weave-net
@@ -62,7 +62,7 @@ items:
- kind: ServiceAccount
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: weave-net
@@ -85,7 +85,7 @@ items:
- configmaps
verbs:
- create
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: weave-net
@@ -134,7 +134,7 @@ items:
port: 6784
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
@@ -165,7 +165,7 @@ items:
#npc-args
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
+6 -6
View File
@@ -8,7 +8,7 @@ items:
labels:
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: weave-net
@@ -48,7 +48,7 @@ items:
verbs:
- patch
- update
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: weave-net
@@ -62,7 +62,7 @@ items:
- kind: ServiceAccount
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: weave-net
@@ -85,7 +85,7 @@ items:
- configmaps
verbs:
- create
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: weave-net
@@ -137,7 +137,7 @@ items:
port: 6784
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
@@ -168,7 +168,7 @@ items:
#npc-args
resources:
requests:
cpu: 10m
cpu: 50m
securityContext:
privileged: true
volumeMounts:
+30
View File
@@ -2,5 +2,35 @@
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)
exec /usr/bin/weave-npc $EXTRA_ARGS $@
+14 -6
View File
@@ -482,7 +482,7 @@ func (fastdp *FastDatapath) getVxlanVportID(udpPort int) (odp.VportID, error) {
// The netdev interface is down, so most likely bringing it up
// has failed due to the UDP port being in use.
if err := fastdp.dp.DeleteVport(vxlanVportID); err != nil {
log.Warning("Unable to remove vxlan vport %d: %s", vxlanVportID, err)
log.Warningf("Unable to remove vxlan vport %d: %s", vxlanVportID, err)
}
return 0, odp.NetlinkError(syscall.EADDRINUSE)
}
@@ -654,27 +654,26 @@ func (fwd *fastDatapathForwarder) logPrefix() string {
func (fwd *fastDatapathForwarder) Confirm() {
fwd.lock.Lock()
defer fwd.lock.Unlock()
if fwd.confirmed {
log.Fatal(fwd.logPrefix(), "already confirmed")
}
var controlMsg []byte
if fwd.fastdp.ipsec != nil && fwd.sessionKey != nil {
fwd.isEncrypted = true
log.Info("Setting up IPsec between ", fwd.fastdp.localPeer, " and ", fwd.remotePeer)
err := fwd.fastdp.ipsec.InitSALocal(
var err error
controlMsg, err = fwd.fastdp.ipsec.InitSALocal(
fwd.fastdp.localPeer.Name, fwd.remotePeer.Name, fwd.connUID,
net.IP(fwd.localIP[:]), fwd.remoteAddr.IP,
fwd.remoteAddr.Port,
fwd.sessionKey,
func(msg []byte) error {
return fwd.sendControlMsg(FastDatapathCryptoInitSARemote, msg)
},
)
if err != nil {
log.Error(fwd.logPrefix(), "ipsec init SA local failed: ", err)
fwd.handleError(err)
fwd.lock.Unlock()
return
}
}
@@ -692,6 +691,15 @@ func (fwd *fastDatapathForwarder) Confirm() {
}
fwd.heartbeatTimeout = time.NewTimer(HeartbeatTimeout)
fwd.lock.Unlock() // unlock before calling send() which may block
if err := fwd.sendControlMsg(FastDatapathCryptoInitSARemote, controlMsg); err != nil {
log.Error(fwd.logPrefix(), "ipsec send InitSARemote failed: ", err)
fwd.handleError(err)
return
}
go fwd.doHeartbeats()
}
+21 -18
View File
@@ -89,23 +89,18 @@ Kubernetes manages
on each node, and only schedules pods to run on nodes that have enough
free resources.
The components of a typical Kubernetes installation (with the master
node running etcd, scheduler, api-server, etc.) take up about 95% of a
CPU, which leaves little room to run anything else. For all of Weave
Net's features to work, it must run on every node, including the
master.
In the example manifests we request 10% of a CPU, which will be enough
for small installations, but you should monitor how much it uses in
your production clusters and adjust the requests to suit.
The best way to resolve this issue is to use machines with at least
two CPU cores. However if you are installing Kubernetes and Weave Net
for the first time, you may not be aware of this requirement. For this
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.
We do not recommend that you set a CPU or memory _limit_ unless you
are very experienced in such matters, because the implementation of
limits in the Linux kernel sometimes behaves in a surprising way.
Depending on the workload, Weave Net may need more than 1% of the
CPU. The percentage set in the DaemonSet is the minimum and not a
limit. This minimum setting allows Weave Net to take advantage of
available CPU and "burst" above that limit if it needs to.
On a 1-node single-CPU cluster you may find Weave Net does not install
at all, because other Kubernetes components already take 95% of the
CPU. The best way to resolve this issue is to use machines with at
least two CPU cores.
## <a name="eviction"></a>Pod Eviction
@@ -231,8 +226,7 @@ You may also set the `--log-level` flag to `warning` or `error` if you
prefer to only log exceptional conditions.
Many Kubernetes network issues occur at a higher level than Weave Net.
The [Kubernetes Service Debugging Guide]
(https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/)
The [Kubernetes Service Debugging Guide](https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/)
has a detailed step-by-step guide.
Once it is up and running, the status of Weave Net can be checked by
@@ -384,7 +378,7 @@ The list of variables you can set is:
* `CHECKPOINT_DISABLE` - if set to 1, disable checking for new Weave Net
versions (default is blank, i.e. check is enabled)
* `CONN_LIMIT` - soft limit on the number of connections between
peers. Defaults to 100.
peers. Defaults to 200.
* `HAIRPIN_MODE` - Weave Net defaults to enabling hairpin on the bridge side of
the `veth` pair for containers attached. If you need to disable hairpin, e.g. your
kernel is one of those that can panic if hairpin is enabled, then you can disable it
@@ -412,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
accessing Service annotated with `service.spec.externalTrafficPolicy=Local`.
The feature works only with Weave IPAM (default).
* `IPTABLES_BACKEND` - set to `nft` to use `nftables` backend for `iptables` (default is `iptables`)
Example:
```
@@ -458,3 +453,11 @@ You must pass the `password-secret` option as noted in the previous section to e
A different option is to use `trusted-subnets` and whitelist only the subnets that host your k8s nodes. Mind that depending on your circumstances that might allow a malicious container running in your cluster to access the weave dataplane, still.
Read on the [Securing Connections Across Untrusted Networks](/site/tasks/manage/security-untrusted-networks/) document to see the alternatives.
To improve security drop `CAP_NET_RAW` from pod capabilities: by default pods can forge packets from anywhere on the network, which enables attacks such as DNS spoofing.
```
securityContext:
capabilities:
drop: ["NET_RAW"]
```
+16 -1
View File
@@ -13,7 +13,22 @@ Weave Net detects when a container has exited and releases its allocated address
See the [Automatic IP Address Management](/site/tasks/ipam/ipam.md) and also an explanation of [the basics of IP addressing](/site/concepts/ip-addresses.md) for further details.
Instead of allowing Weave Net to allocate IP addresses automatically (using IPAM), there may be instances where you need to control a particular container or a cluster by setting an IP address for it.
Instead of allowing Weave Net to allocate IP addresses automatically (using IPAM), there may be instances where you need to control a particular container or a cluster by setting an IP address for it. The way to do this varies according to how containers are attached to Weave Net.
## Manually specifying an IP address when using CNI
The software making a call to CNI has to specify an allocator that allows static IPs.
For instance the [static allocator](https://github.com/containernetworking/plugins/tree/master/plugins/ipam/static)
(At the time of writing there is no straightforward way to ask Kubernetes to do this.)
## Manually specifying an IP address when using the Weave Net Docker Plugin
Docker has a flag `--ip` to specify an address, e.g.:
$ docker run --network=mynetwork --ip=172.18.0.22 ...
## Manually specifying an IP address when using the Weave Net Docker Proxy
You can specify an IP address and a network explicitly, using Classless Inter-Domain Routing or [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing).
+2 -1
View File
@@ -206,7 +206,8 @@ function set_hosts() {
function provision_remotely() {
case "$1" in
on)
terraform apply -input=false -parallelism="$NUM_HOSTS" -var "app=$APP" -var "name=$NAME" -var "num_hosts=$NUM_HOSTS" "$DIR/../tools/provisioning/$2"
terraform init "$DIR/../tools/provisioning/gcp"
terraform apply -auto-approve -input=false -parallelism="$NUM_HOSTS" -var "app=$APP" -var "name=$NAME" -var "num_hosts=$NUM_HOSTS" "$DIR/../tools/provisioning/$2"
local status=$?
ssh_user=$(terraform output username)
ssh_id_file=$(terraform output private_key_path)
+1 -1
Submodule tools updated: f041a74ffb...2a2df52789.