Compare commits

...
49 Commits
Author SHA1 Message Date
Martynas Pumputis 20919fd6db Add release v2.3.0 2018-04-09 14:56:31 +00:00
Martynas Pumputis ada2af04ff Merge pull request #3271 from weaveworks/metrics-addr
Only expose metrics by default in weave-kube
2018-04-09 15:05:22 +02:00
Bryan Boreham fcb6f762a9 Review feedback 2018-04-09 13:42:09 +01:00
Bryan Boreham 5645f31934 Update docs for metrics endpoints 2018-04-09 13:11:29 +01:00
Bryan Boreham a7295e2d03 Mention metrics and status addresses in the docs 2018-04-09 11:55:50 +01:00
Bryan Boreham c3e6ac2cac Merge pull request #3273 from weaveworks/go1.10.1
Use go1.10.1 for building
2018-04-09 11:40:11 +01:00
Martynas Pumputis f1f3c8c8fe Use go1.10.1 for building 2018-04-09 09:46:45 +02:00
Bryan Boreham 81b2f2e15a Merge pull request #3266 from weaveworks/test-k8s-1-10
Update tests to run against Kubernetes 1.10
2018-04-04 15:17:42 +01:00
Bryan Boreham f6fdaf6492 Only expose metrics by default in weave-kube 2018-04-04 15:00:53 +01:00
Bryan Boreham 519c5d686a Remove test for k8s 1.6 which breaks on 1.10 2018-04-04 12:26:18 +01:00
Bryan Boreham f7e62ccbcc Bump Kubernetes to 1.10 2018-04-04 12:26:09 +01:00
Bryan Boreham 19161c0c92 Merge branch '2.2' 2018-03-30 19:17:18 +00:00
Bryan Boreham c528303841 Merge pull request #3265 from weaveworks/raise-kube-conn-limit
Raise weave-kube default connection limit from 30 to 100
2018-03-28 10:20:30 +01:00
Bryan Boreham a439288765 Raise weave-kube default connection limit from 30 to 100
This was missed from 265bfcf
2018-03-27 21:06:41 +00:00
Bryan Boreham 416410912d Merge pull request #3263 from weaveworks/faq-unique-peers
Add 'peer names collision' to FAQ
2018-03-23 15:14:21 +00:00
Bryan Boreham b3f26f00e2 Add some hints how to set the unique ID 2018-03-23 14:55:54 +00:00
Bryan Boreham 90e6ecdd11 Add 'peer names collision' to FAQ 2018-03-23 14:10:05 +00:00
Marc Carré 842354bc5a Add links from email received from Docker Store. 2018-03-20 10:30:52 +00:00
Marc Carré 4d3875cec2 Add details on email for Docker Store release. 2018-03-20 10:29:50 +00:00
Marc Carré 74dfe49046 Fix format in Docker Store instructions. 2018-03-19 14:19:47 +00:00
Marc Carré d0f23ed9e0 Document Docker Store release process. 2018-03-19 11:49:40 +00:00
Martynas Pumputis 8a0992315e Merge branch '2.2' 2018-03-12 18:27:04 +01:00
Martynas Pumputis 18b5cb10dc Add release v2.2.1 2018-03-12 15:02:36 +01:00
Bryan Boreham 8afc6f208d Merge pull request #3253 from NathanHaim/issues/3245_change_golang_version
Update golang version to 1.10
2018-03-12 12:11:30 +00:00
Martynas Pumputis d35d931179 Fix invalid format in ipam/testutils_test.go
Caught after upgrading Go to 1.10 in build tools.
2018-03-12 11:04:41 +00:00
NathanHaim 093174e757 add golang:1.10.0 2018-03-11 23:08:41 +01:00
Martynas Pumputis ac78762910 Merge branch '2.2' 2018-03-08 14:38:46 +01:00
Martynas Pumputis fff656f7e4 Merge pull request #3235 from weaveworks/wait-5-sec
Wait 5 seconds to let pod connect before rolling next pod
2018-03-08 14:36:11 +01:00
Martynas Pumputis 83b36e4c76 Merge branch '2.2' 2018-03-08 14:26:32 +01:00
Martynas Pumputis b42895b5c0 Merge pull request #3250 from alok87/del_default_ipset
Delete defaultAllowIPSet on namespace delete

Fix #3247

Duplicate merge commit as the PR got merged to "master" instead of "2.2"
2018-03-08 14:22:33 +01:00
Martynas Pumputis 42e4b9addc Merge pull request #3250 from alok87/del_default_ipset
Delete defaultAllowIPSet on namespace delete

Fix #3247
2018-03-08 14:01:10 +01:00
alok87 91ab0e4a76 Clean defaultAllowIPSet on namespace delete 2018-03-05 22:52:56 +05:30
NathanHaim 51feec3785 change golang version 2018-03-05 02:46:35 +01:00
Bryan Boreham 20eee3818e Merge pull request #3236 from weaveworks/apk-ca-certs
Install ca-certificates instead of copying them
2018-02-28 17:00:31 +00:00
Bryan Boreham 94cd6226ea Merge branch '2.2' 2018-02-28 16:58:22 +00:00
Bryan Boreham 5534ecf1b1 Merge pull request #3237 from weaveworks/issues/3222-dst-selector
Fix bug when dstSelector is overwritten by srcSelector
2018-02-28 16:56:07 +00:00
Bryan Boreham d498df3933 Merge branch '2.2' 2018-02-28 10:32:45 +00:00
Bryan Boreham 75bf62ca80 Merge pull request #3234 from weaveworks/raise-conn-limit
Raise default connection limit from 30 to 100
2018-02-26 17:15:56 +00:00
Marc Carré ad42357dd6 Improve formatting. 2018-02-21 10:31:04 +00:00
Marc Carré 2de899342a Improve naming consistency. 2018-02-21 10:30:35 +00:00
Marc Carré 8df48dc69d Document how to pull submodules on first checkout: git submodule update --init 2018-02-21 10:25:33 +00:00
Marc Carré 0f2809d2e9 Document how to pull submodules on first checkout: git submodule update --init 2018-02-21 10:23:08 +00:00
Marc Carré aa44153af7 Minor typos and improvements. 2018-02-21 10:19:38 +00:00
Bryan Boreham ce9c5162bd Merge pull request #3238 from weaveworks/fix-k8s-weave-passwd-howto
Fix HOWTO for setting weave-kube passwd
2018-02-04 16:29:14 +00:00
Martynas Pumputis 5c0da56ad5 Fix HOWTO for setting weave-kube passwd
A quick fix.

LG generates secretKeyRef.key w/o the ".txt" extension which makes it
inaccessible to weave-kube when passwd is stored in "weave-passwd.txt".
2018-02-04 14:43:41 +01:00
Martynas Pumputis 08858c2a10 npc: Fix bug when dstSelector is overwritten by srcSelector
There was a bug in the npc analyser when adding a netpol with
dstSelector == srcSelector. The analyser was overwriting
dstSelector with srcSelector which resulted in Pod selected
by dstSelector not being removed from a corresponding
"default-allow" ipset.

This applies only to non-legacy netpols.
2018-02-04 13:23:38 +01:00
Martynas Pumputis 0268aeb25f Install ca-certificates instead of copying them
There is a package for alpine:
https://pkgs.alpinelinux.org/packages?name=ca-certificates&branch=v3.6
2018-02-01 14:44:00 +01:00
Bryan Boreham ea3aba8971 Wait 5 seconds to let pod connect before rolling next pod 2018-01-31 10:54:07 +00:00
Bryan Boreham 265bfcf9d7 Raise default connection limit from 30 to 100 2018-01-31 10:48:05 +00:00
20 changed files with 256 additions and 4538 deletions

No files matched your search

+46
View File
@@ -1,3 +1,49 @@
## Release 2.3.0
### Security fixes
* By default, do not expose Weave "/status" and "/report" to all (0.0.0.0) when
running on Kubernetes #3271
### Other improvements
* Increase the default connection limit for Weave peers (from 30 to 100) when
running on Kubernetes, so that more peers could directly connect #3265
## Build and test
* Build Weave Net with Go 1.10.1 #3273
* Run integration tests against Kubernetes 1.10.0 #3266
[Full list of changes](https://github.com/weaveworks/weave/milestone/70?closed=1)
## Release 2.2.1
### Bug fixes
* Fix a bug in weave-npc which would allow ingress traffic to Kubernetes Pods selected
by a NetworkPolicy in which source and destination selectors were the same #3222,#3237
* Fix a bug in weave-npc which would crash if a previously deleted Kubernetes Namespace
has been created again #3247,#3250
### Other improvements
* Increase the default connection limit for Weave peers (from 30 to 100), so that
more peers could directly connect #3234
* When doing a rolling update of Weave Net on Kubernetes, allow each node five seconds
to initialize before rolling next Weave Net Pod, so that issues at startup will halt
the rollout and not spread across the whole cluster #3235
* Install common CA certificates from Alpine Linux package instead of copying
them manually #3236
### External contributors
Thanks to the following contributors:
* @alok87
[Full list of changes](https://github.com/weaveworks/weave/milestone/71?closed=1)
## Release 2.2.0
This release improves the way Weave Net configures Linux network
+1 -1
View File
@@ -1,3 +1,3 @@
DOCKER_VERSION=17.06
KUBERNETES_VERSION=1.9.2
KUBERNETES_VERSION=1.10.0
KUBERNETES_CNI_VERSION=0.6.0
+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.8.1
FROM golang:1.10.1-stretch
# Support Raspberry Pi 2 and newer
ENV GOARM 7
+22
View File
@@ -127,6 +127,28 @@ Finally, for **Mainline** releases only:
* Images tagged `latest` are updated on DockerHub
### Docker Store
Weave Net is [available in Docker Store](https://store.docker.com/plugins/weave-net-plugin) and should also be released there.
* Go to https://store.docker.com/ and log in.
* Go to "[_Publish_](https://store.docker.com/publisher/center)".
* Under "_My Products_", select "_owners (weaveworks)_". Weave Net should be listed among our products.
* Click "_Actions_" > "_Edit Product_".
* Go to "_Plans & Pricing_" > "_Free Tier_".
* Under "_Source Repositories & Tags_", click on "_Add Source_", select "_net-plugin_" under "_Repository_" and the version to release under "_Tag_".
* Under "_Resources_" > "_Installation Instructions_", update the lines containing `export NET_VERSION=<version>`.
* Click "_Submit For Review_". You should see a message like: "_Your product has been submitted for approval. [...] We'll be in touch with next steps soon!_".
* You should receive an email saying:
> This email confirms that we received your submission on \<date\> of Weave Net to the Docker Store.
>
> We're reviewing your submission to ensure that it meets our [security guidelines](https://success.docker.com/Store#Security_and_Audit_Policies) and complies with our [best practices](https://success.docker.com/Store#Create_Great_Content). Don't worry! We'll let you know if there's anything you need to change before we publish your submission. You should hear back from us within the next 14 days.
>
> Thanks for submitting your content to the Docker Store!
* Hope Docker eventually performs the release or contacts us. If nothing happens within 14 days, contact their support team: publisher-support@docker.com.
### Finish up
* If not on master, merge branch into master and push to GitHub.
+1 -1
View File
@@ -117,7 +117,7 @@ func CheckAllExpectedMessagesSent(allocs ...*Allocator) {
m := alloc.gossip.(*mockGossipComms)
m.RLock()
if len(m.messages) > 0 {
require.FailNow(m, fmt.Sprintf("%s: Gossip message(s) not sent as expected: \n%x", m.name, m.messages))
require.FailNow(m, fmt.Sprintf("%s: Gossip message(s) not sent as expected: \n%v", m.name, m.messages))
}
m.RUnlock()
}
+13 -2
View File
@@ -108,7 +108,12 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) (
if err != nil {
return nil, nil, nil, err
}
podSelectors[dstSelector.key] = dstSelector
// To prevent dstSelector being overwritten by a subsequent selector with
// the same key, addIfNotExist MUST be used when adding to podSelectors.
// Otherwise, dstSelector' "dst" property might be lost resulting in
// an invalid content of the "default-allow" ipset.
addIfNotExist(dstSelector, podSelectors)
// If ingress is empty then this NetworkPolicy does not allow any traffic
if policy.Spec.Ingress == nil || len(policy.Spec.Ingress) == 0 {
@@ -142,7 +147,7 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) (
if err != nil {
return nil, nil, nil, err
}
podSelectors[srcSelector.key] = srcSelector
addIfNotExist(srcSelector, podSelectors)
} else if peer.NamespaceSelector != nil {
srcSelector, err = newSelectorSpec(peer.NamespaceSelector, false, "", ipset.ListSet)
@@ -168,6 +173,12 @@ func (ns *ns) analysePolicy(policy *networkingv1.NetworkPolicy) (
return rules, nsSelectors, podSelectors, nil
}
func addIfNotExist(s *selectorSpec, ss map[string]*selectorSpec) {
if _, ok := ss[s.key]; !ok {
ss[s.key] = s
}
}
func withNormalisedProtoAndPortLegacy(npps []extnapi.NetworkPolicyPort, f func(proto, port string)) {
for _, npp := range npps {
f(proto(npp.Protocol), port(npp.Port))
+78
View File
@@ -294,6 +294,11 @@ func TestDefaultAllow(t *testing.T) {
controller.DeletePod(podFoo)
// Should remove foo pod from default-allow
require.False(t, m.entryExists(defaultAllowIPSetName, fooPodIP))
controller.DeleteNamespace(defaultNamespace)
// Should remove default ipset
require.NotContains(t, m.sets, defaultAllowIPSetName)
}
func TestOutOfOrderPodEvents(t *testing.T) {
@@ -376,3 +381,76 @@ func TestOutOfOrderPodEvents(t *testing.T) {
require.Equal(t, 0, len(m.sets[defaultAllowIPSetName].subSets))
require.False(t, m.entryExists(runBarIPSetName, podIP))
}
// Test case for https://github.com/weaveworks/weave/issues/3222
func TestNewDstSelector(t *testing.T) {
const (
defaultAllowIPSetName = "weave-E.1.0W^NGSp]0_t5WwH/]gX@L"
podIP = "10.32.0.10"
)
m := newMockIPSet()
controller := New("baz", false, &mockIPTables{}, &m)
defaultNamespace := &coreapi.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
},
}
controller.AddNamespace(defaultNamespace)
podFoo := &coreapi.Pod{
ObjectMeta: metav1.ObjectMeta{
UID: "foo",
Namespace: "default",
Name: "foo",
Labels: map[string]string{"run": "foo"}},
Status: coreapi.PodStatus{PodIP: podIP}}
controller.AddPod(podFoo)
require.True(t, m.entryExists(defaultAllowIPSetName, podIP))
netpolBar := &networkingv1.NetworkPolicy{
ObjectMeta: metav1.ObjectMeta{
UID: "netpol-bar",
Name: "allow-from-default-1",
Namespace: "default",
},
Spec: networkingv1.NetworkPolicySpec{
PodSelector: metav1.LabelSelector{},
Ingress: []networkingv1.NetworkPolicyIngressRule{{
From: []networkingv1.NetworkPolicyPeer{{
PodSelector: &metav1.LabelSelector{},
}},
}},
},
}
controller.AddNetworkPolicy(netpolBar)
// netpolBar dst selector selects podFoo
require.False(t, m.entryExists(defaultAllowIPSetName, podIP))
netpolFoo := &networkingv1.NetworkPolicy{
ObjectMeta: metav1.ObjectMeta{
UID: "netpol-foo",
Name: "allow-from-default-2",
Namespace: "default",
},
Spec: networkingv1.NetworkPolicySpec{
PodSelector: metav1.LabelSelector{},
Ingress: []networkingv1.NetworkPolicyIngressRule{{
From: []networkingv1.NetworkPolicyPeer{{
PodSelector: &metav1.LabelSelector{},
}},
}},
},
}
controller.AddNetworkPolicy(netpolFoo)
controller.DeleteNetworkPolicy(netpolBar)
// netpolFoo dst-selects podFoo
require.False(t, m.entryExists(defaultAllowIPSetName, podIP))
controller.DeleteNetworkPolicy(netpolFoo)
// No netpol dst-selects podFoo
require.True(t, m.entryExists(defaultAllowIPSetName, podIP))
}
+10 -1
View File
@@ -471,7 +471,16 @@ func (ns *ns) deleteNamespace(obj *coreapi.Namespace) error {
}
// Remove namespace ipset from any matching namespace selectors
return ns.nsSelectors.delFromMatching(obj.ObjectMeta.UID, obj.ObjectMeta.Labels, string(ns.allPods.ipsetName))
err := ns.nsSelectors.delFromMatching(obj.ObjectMeta.UID, obj.ObjectMeta.Labels, string(ns.allPods.ipsetName))
if err != nil {
return err
}
if !ns.legacy {
return ns.ips.Destroy(ns.defaultAllowIPSet)
}
return nil
}
func (ns *ns) isDefaultDeny(namespace *coreapi.Namespace) bool {
+9 -3
View File
@@ -27,9 +27,9 @@ xt_set_exists() {
# 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}
STATUS_ADDR=${WEAVE_STATUS_ADDR:-0.0.0.0:6782}
METRICS_ADDR=${WEAVE_METRICS_ADDR:-0.0.0.0:6782}
HOST_ROOT=${HOST_ROOT:-/host}
CONN_LIMIT=${CONN_LIMIT:-30}
CONN_LIMIT=${CONN_LIMIT:-100}
DB_PREFIX=${DB_PREFIX:-/weavedb/weave-net}
# Check if the IP range overlaps anything existing on the host
@@ -54,6 +54,12 @@ else
fi
fi
STATUS_OPTS="--metrics-addr=$METRICS_ADDR"
# --status-addr exposes internal information, so only turn it on if asked to.
if [ -n "${WEAVE_STATUS_ADDR}" ]; then
STATUS_OPTS="$STATUS_OPTS --status-addr=$WEAVE_STATUS_ADDR"
fi
# Default is that npc will be running; allow caller to override
WEAVE_NPC_OPTS="--expect-npc"
if [ "${EXPECT_NPC}" = "0" ]; then
@@ -144,7 +150,7 @@ post_start_actions &
/home/weave/weaver $EXTRA_ARGS --port=6783 $(router_bridge_opts) \
--name="$PEERNAME" \
--host-root=$HOST_ROOT \
--http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR --docker-api='' --no-dns \
--http-addr=$HTTP_ADDR $STATUS_OPTS --docker-api='' --no-dns \
--db-prefix="$DB_PREFIX" \
--ipalloc-range=$IPALLOC_RANGE $NICKNAME_ARG \
--ipalloc-init $IPALLOC_INIT \
@@ -101,6 +101,8 @@ items:
name: weave-net
namespace: kube-system
spec:
# Wait 5 seconds to let pod connect before rolling next pod
minReadySeconds: 5
template:
metadata:
labels:
+1 -1
View File
@@ -21,11 +21,11 @@ RUN apk add --update \
util-linux \
conntrack-tools \
bind-tools \
ca-certificates \
&& rm -rf /var/cache/apk/*
ADD ./weave ./weaver /home/weave/
ADD ./weaveutil /usr/bin/
ADD weavedata.db /weavedb/
COPY ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/home/weave/weaver"]
WORKDIR /home/weave
File diff suppressed because it is too large. Load diff
+11 -2
View File
@@ -155,6 +155,7 @@ func main() {
noDiscovery bool
httpAddr string
statusAddr string
metricsAddr string
ipamConfig ipamConfig
dockerAPI string
peers []string
@@ -186,12 +187,13 @@ func main() {
mflag.StringVar(&logLevel, []string{"-log-level"}, "info", "logging level (debug, info, warning, error)")
mflag.BoolVar(&pktdebug, []string{"-pkt-debug"}, false, "enable per-packet debug logging")
mflag.StringVar(&prof, []string{"-profile"}, "", "enable profiling and write profiles to given path")
mflag.IntVar(&config.ConnLimit, []string{"-conn-limit"}, 30, "connection limit (0 for unlimited)")
mflag.IntVar(&config.ConnLimit, []string{"-conn-limit"}, 100, "connection limit (0 for unlimited)")
mflag.BoolVar(&noDiscovery, []string{"-no-discovery"}, false, "disable peer discovery")
mflag.IntVar(&bufSzMB, []string{"-bufsz"}, 8, "capture buffer size in MB")
mflag.IntVar(&bridgeConfig.MTU, []string{"-mtu"}, 0, "MTU size")
mflag.StringVar(&httpAddr, []string{"-http-addr"}, "", "address to bind HTTP interface to (disabled if blank, absolute path indicates unix domain socket)")
mflag.StringVar(&statusAddr, []string{"-status-addr"}, "", "address to bind status+metrics interface to (disabled if blank, absolute path indicates unix domain socket)")
mflag.StringVar(&metricsAddr, []string{"-metrics-addr"}, "", "address to bind metrics interface to (disabled if blank, absolute path indicates unix domain socket)")
mflag.StringVar(&ipamConfig.Mode, []string{"-ipalloc-init"}, "", "allocator initialisation strategy (consensus, seed or observer)")
mflag.StringVar(&ipamConfig.IPRangeCIDR, []string{"-ipalloc-range"}, "", "IP address range reserved for automatic allocation, in CIDR notation")
mflag.StringVar(&ipamConfig.IPSubnetCIDR, []string{"-ipalloc-default-subnet"}, "", "subnet to allocate within by default, in CIDR notation")
@@ -474,10 +476,17 @@ func main() {
muxRouter.Methods("GET").Path("/metrics").Handler(metricsHandler(router, allocator, ns, dnsserver))
statusMux := http.NewServeMux()
statusMux.Handle("/", muxRouter)
Log.Println("Listening for metrics requests on", statusAddr)
Log.Println("Listening for status+metrics requests on", statusAddr)
go listenAndServeHTTP(statusAddr, statusMux)
}
if metricsAddr != "" {
metricsMux := http.NewServeMux()
metricsMux.Handle("/metrics", metricsHandler(router, allocator, ns, dnsserver))
Log.Println("Listening for metrics requests on", metricsAddr)
go listenAndServeHTTP(metricsAddr, metricsMux)
}
if plugin != nil {
go plugin.Start(httpAddr, dockerCli, waitReady.Add())
}
+17 -15
View File
@@ -6,27 +6,28 @@ search_type: Documentation
You only need to build Weave Net if you want to work on the Weave Net codebase
(or you just enjoy building software).
Apart from the `weave` shell script, weave is delivered as a set of
Apart from the `weave` shell script, Weave Net is delivered as a set of
container images. There is no distribution-specific packaging, so in
principle it shouldn't matter which Linux distribution you build
under. But naturally, Docker is a prerequisite (version 1.6.0 or
later).
The only way to build is by using the the build container; the
Makefile is setup to make this transparent. This method is
`Makefile` is setup to make this transparent. This method is
documented below, and can be run directly on your machine or using
a Vagrant VM.
## <a name="ubuntu"></a>Building directly on your machine
The weave git repository should be cloned into
`$GOPATH/src/github.com/weaveworks/weave`, in accordance with [the go
`$GOPATH/src/github.com/weaveworks/weave`, in accordance with [the Go
workspace conventions](https://golang.org/doc/code.html#Workspaces):
```
$ WEAVE=github.com/weaveworks/weave
$ git clone https://$WEAVE $GOPATH/src/$WEAVE
$ cd $GOPATH/src/$WEAVE
$ git submodule update --init
```
Next install Docker if you haven't already, by following the instructions
@@ -44,7 +45,7 @@ On a fresh repository, the Makefile will do the following:
- build the weave components in the build container
- package them into two Docker images (`weaveworks/weave`,
`weaveworks/weaveexec`)
- Exported these images as `weave.tar.gz`
- export these images as `weave.tar.gz`.
The first two steps may take a while - don't worry, they are
are cached and should not need to be redone very often.
@@ -63,18 +64,19 @@ First, check out the code:
```
$ git clone https://github.com/weaveworks/weave
$ cd weave
$ git submodule update --init
```
The `Vagrantfile` in the top directory constructs a VM that has
The `Vagrantfile` in the top directory constructs a VM that has:
* docker installed
* go tools installed
* weave dependencies installed
* $GOPATH set to ~
* Docker installed
* Go tools installed
* Weave's dependencies installed
* `$GOPATH` set to `~`
* the local working directory mapped as a synced folder into the
right place in $GOPATH
  right place in `$GOPATH`.
Once you are in the working directory you can issue
Once you are in the working directory you can issue:
```
$ vagrant up
@@ -86,7 +88,7 @@ installation is done just once). The working directory is sync'ed with
use git and so on in the regular filesystem.
To build and run the code, you need to use the VM. To log in and build
the weave image, do
the weave image, do:
```
$ vagrant ssh
@@ -94,7 +96,7 @@ vm$ cd src/github.com/weaveworks/weave
vm$ make
```
The Docker daemon is also running in this VM, so you can then do
The Docker daemon is also running in this VM, so you can then do:
```
vm$ sudo ./weave launch
@@ -104,7 +106,7 @@ vm$ sudo docker ps
and so on.
If you are looking to just do a build and not run anything on this VM,
you can do so with
you can do so with:
```
$ vagrant ssh -c 'make -C src/github.com/weaveworks/weave'
@@ -112,7 +114,7 @@ $ vagrant ssh -c 'make -C src/github.com/weaveworks/weave'
you should then find a `weave.tar.gz` container snapshot tarball in the
top-level directory. You can use that snapshot with `docker load`
against a different host, e.g.
against a different host, e.g.:
```
$ export DOCKER_HOST=tcp://<HOST:PORT>
+12
View File
@@ -40,6 +40,18 @@ A simple way to accomplish this would be to run Weave on the host and then run,
Yet another option is to expose a port from the container on host B and then connect to it. You can read about exposing ports in [Exporting Services](/site/tasks/manage/service-management.md#exporting).
<a name="duplicate-peer"></a>
**Q: Why am I seeing "peer names collision" and failed connections?**
This sometimes happens when machines are cloned; we require each
machine in your cluster to have a unique identity.
For more information see [Peer Names](/site/operational-guide/concepts.md#peer-name).
Depending on your Linux distribution you may need to [set up
machine-id](https://www.freedesktop.org/software/systemd/man/machine-id.html)
or [generate a dbus id](https://dbus.freedesktop.org/doc/dbus-uuidgen.1.html).
<a name="duplicate-ip"></a>
**Q: Why am I seeing the same IP address assigned to two different containers on different hosts?**
+7 -3
View File
@@ -311,11 +311,11 @@ UDP connection from 10.32.0.7:56648 to 10.32.0.11:80 blocked by Weave NPC.
You can customise the YAML you get from `cloud.weave.works` by passing some of Weave Net's options, arguments and environment variables as query parameters:
- `version`: Weave Net's version. Default: `latest`, i.e. latest release. *N.B.*: This only changes the specified version inside the generated YAML file, it does not ensure that the rest of the YAML is compatible with that version. To freeze the YAML version save a copy of the YAML file from the [release page](https://github.com/weaveworks/weave/releases) and use that copy instead of downloading it each time from `cloud.weave.works`.
- `password-secret`: name of the Kubernetes secret containing your password.
- `password-secret`: name of the Kubernetes secret containing your password. *N.B*: The Kubernetes secret name must correspond to a name of a file containing your password.
Example:
$ echo "s3cr3tp4ssw0rd" > /var/lib/weave/weave-passwd.txt
$ kubectl create secret -n kube-system generic weave-passwd --from-file=/var/lib/weave/weave-passwd.txt
$ echo "s3cr3tp4ssw0rd" > /var/lib/weave/weave-passwd
$ kubectl create secret -n kube-system generic weave-passwd --from-file=/var/lib/weave/weave-passwd
$ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')&password-secret=weave-passwd"
- `known-peers`: comma-separated list of hosts. Default: empty.
@@ -346,6 +346,10 @@ The list of variables you can set is:
* `WEAVE_EXPOSE_IP` - set the IP address used as a gateway from the
Weave network to the host network - this is useful if you are
configuring the addon as a static pod.
* `WEAVE_METRICS_ADDR` - address and port that the Weave Net
daemon will serve Prometheus-style metrics on (defaults to 0.0.0.0:6782)
* `WEAVE_STATUS_ADDR` - address and port that the Weave Net
daemon will serve status requests on (defaults to disabled)
* `WEAVE_MTU` - Weave Net defaults to 1376 bytes, but you can set a
smaller size if your underlying network has a tighter limit, or set
a larger size for better performance if your network supports jumbo
+22 -17
View File
@@ -10,9 +10,6 @@ controller](/site/kubernetes/kube-addon.md#npc).
### Router Metrics
The endpoint address is `localhost:6782`; the following metrics are
exposed:
* `weave_connections` - Number of peer-to-peer connections.
* `weave_connection_terminations_total` - Number of peer-to-peer
connections terminated.
@@ -25,27 +22,35 @@ exposed:
* `weave_ipam_pending_allocates` - Number of pending allocates.
* `weave_ipam_pending_claims` - Number of pending claims.
#### Publish Router Metrics Endpoint
By default, when started via `weave launch`, weave listens on its local
interface to serve metrics. To publish your metrics throughout your cluster,
e.g. if your prometheus server is installed on a different host machine,
you need to set `WEAVE_STATUS_ADDR` to your corresponding IP and port.
Default port is 6782.
`WEAVE_STATUS_ADDR=X.X.X.X:PORT`
You can set `WEAVE_STATUS_ADDR=0.0.0.0:6782` to listen on all interfaces,
but be aware, this may expose your metrics to the public internet.
### Kubernetes Network Policy Controller Metrics
The endpoint address is `localhost:6781`; the following metric is
The following metric is
exposed:
* `weavenpc_blocked_connections_total` - Connection attempts blocked
by policy controller.
### Metrics Endpoint Addresses
When installed as a Kubernetes Addon, the router listens for metrics
requests on 0.0.0.0:6782 and the Network Policy Controller listens on
0.0.0.0:6781. No other requests are served on these endpoints.
>Note: If your Kubernetes hosts are exposed to the public internet
then these metrics endpoints will also be exposed.
When started via `weave launch`, by default weave listens on its local
interface to serve metrics and other read-only status requests. To
publish your metrics throughout your cluster, you can set
`WEAVE_STATUS_ADDR`:
`WEAVE_STATUS_ADDR=X.X.X.X:PORT`
Set it to an empty string to disable.
You can also pass the parameter `--metrics-addr=X.X.X.X:PORT` to
`weave launch` to specify an address to listen for metrics only.
# Static Configuration for Weave Net
The following YAML fragment can be used in your Prometheus configuration to
+1 -2
View File
@@ -34,11 +34,10 @@ docker_on $HOST1 run --rm --privileged --net=host --entrypoint=/usr/sbin/ipset w
# kubeadm init upgrades to latest Kubernetes version by default, therefore we try to lock the version using the below option:
k8s_version="$(run_on $HOST1 "kubelet --version" | grep -oP "(?<=Kubernetes )v[\d\.\-beta]+")"
k8s_version_option="$([[ "$k8s_version" > "v1.6" ]] && echo "kubernetes-version" || echo "use-kubernetes-version")"
for host in $HOSTS; do
if [ $host = $HOST1 ] ; then
run_on $host "sudo systemctl start kubelet && sudo kubeadm init --$k8s_version_option=$k8s_version --token=$TOKEN --pod-network-cidr=$WEAVE_NETWORK"
run_on $host "sudo systemctl start kubelet && sudo kubeadm init --kubernetes-version=$k8s_version --token=$TOKEN --pod-network-cidr=$WEAVE_NETWORK"
else
run_on $host "sudo systemctl start kubelet && sudo kubeadm join --token=$TOKEN --discovery-token-unsafe-skip-ca-verification $HOST1IP:$KUBE_PORT"
fi
@@ -38,11 +38,10 @@ function setup_kubernetes_cluster {
# kubeadm init upgrades to latest Kubernetes version by default, therefore we try to lock the version using the below option:
k8s_version="$(run_on $HOST1 "kubelet --version" | grep -oP "(?<=Kubernetes )v[\d\.\-beta]+")"
k8s_version_option="$([[ "$k8s_version" > "v1.6" ]] && echo "kubernetes-version" || echo "use-kubernetes-version")"
for host in $HOSTS; do
if [ $host = $HOST1 ] ; then
run_on $host "sudo systemctl start kubelet && sudo kubeadm init --$k8s_version_option=$k8s_version --token=$TOKEN"
run_on $host "sudo systemctl start kubelet && sudo kubeadm init --kubernetes-version=$k8s_version --token=$TOKEN"
else
run_on $host "sudo systemctl start kubelet && sudo kubeadm join --token=$TOKEN --discovery-token-unsafe-skip-ca-verification $HOST1IP:$KUBE_PORT"
fi
+1 -1
View File
@@ -16,7 +16,7 @@ def ansibleize(h)
end
def get_go_version_from_build_dockerfile()
go_regexp = /FROM golang:(\S*).*?/
go_regexp = /FROM golang:([\d\.]*).*?/
dockerfile_path = File.expand_path(File.join(File.dirname(__FILE__), 'build', 'Dockerfile'))
go_version = File.readlines(dockerfile_path).select { |line| line.match(go_regexp) }.first.match(go_regexp).captures.first
if go_version.nil?