Compare commits

..
17 Commits
Author SHA1 Message Date
Murali Reddy 4b5d827d94 Add release v2.5.2 2019-05-16 11:42:47 +05:30
Bryan Boreham 6e78a34a00 Merge pull request #3638 from weaveworks/pruneowned
return error in case Weave CNI plug-in fails to perform CmdDel
2019-05-10 15:32:47 +01:00
Murali Reddy ac9d72875d ignore the error on IPAM delete for the container with 0 addresses 2019-05-10 17:25:58 +05:30
Bryan Boreham 690b6ff2cd Merge pull request #3623 from weaveworks/ensure-cml-initialised
Avoid panic on nil map in reclaimPeer()
2019-05-07 14:30:40 +01:00
Bryan Boreham 8a4fc9c02a Fix peer-list fuzz test to re-fetch list when it may be nil 2019-05-03 17:25:36 +00:00
Bryan Boreham 760bc10074 Merge pull request #3629 from weaveworks/issue-3628
gossip broadcast updated ring on donating a range to other peer
2019-05-03 16:32:23 +01:00
Bryan Boreham 47d8f24e56 Merge pull request #3635 from weaveworks/issue-3632
bump up the version of entry by large value so that transfer of range takes precedence
2019-04-30 10:24:53 +01:00
Murali Reddy 4f8fe2c13f gossip broadcast updated rin on donating a range to other peer
Fixes #3628
2019-04-26 15:21:23 +05:30
Murali Reddy 873781ab58 bump up the version of entry by large value so that transfer of range
takes precedence (if there is any conflict in merging entry) over
other operations on the entry that increments the version

Fixes #3612
2019-04-26 15:15:47 +05:30
Bryan Boreham eb7ba691ee Fetch storedPeerList after read from Kubernetes
This avoids a race condition where the peer has added itself to the
list and the annotation since we read storedPeerList.
2019-04-02 09:11:27 +00:00
Bryan Boreham 15b9b7416a Re-read peers ConfigMap from Kubernetes at start of every reclaim
A previous reclaim may have left the map set to nil.
2019-03-26 17:25:34 +00:00
Bryan Boreham 5024270232 Avoid panic on nil map
It can be set to nil after a failed update; check rather than crashing.
2019-03-26 17:20:24 +00:00
Bryan Boreham bd24dd7dae Make test harness and comments match Kubernetes behaviour on conflict error
Kubernetes always returns nil on error; somehow I had the wrong idea
here.
2019-03-26 17:19:22 +00:00
Bryan Boreham b248e021ec Merge pull request #3457 from weaveworks/release-process-update
Update release process doc with minor details
2019-02-13 12:06:54 +00:00
Bryan Boreham e23e364476 Merge pull request #3594 from weaveworks/document_weave_log_warning_and_error_levels
Document weave log warning and error levels
2019-02-07 16:38:46 +00:00
Jerry Jackson 8a5aa1a6ae Document weave log warning and error levels 2019-02-07 08:19:46 -07:00
Bryan Boreham 583eea1ec5 Update release process doc with minor details 2018-11-22 14:26:18 +00:00
10 changed files with 55 additions and 16 deletions

No files matched your search

+17
View File
@@ -1,3 +1,20 @@
## Release 2.5.2
This release fixes several bugs causing inconsistencies in IPAM and fixes a
panic in daemon that reclaims and forgets deleted nodes in Kubernetes clusters.
### Bug fixes
* leaking IP addresses in IPAM when weave-net hangs or restarting #3587, #3638
* Panic in kube-utils after config map update error resulting in reclaim daemon
not performing weave forget on deleted node #3613, #3623
* preventing inconsistent IPAM entries and resolving the conflict in case of
conflict during IPAM ring merge #3629, #3635, #3632, #3444
[Full list of changes](https://github.com/weaveworks/weave/milestone/79?closed=1)
## Release 2.5.1
This release fixes bugs reported for 2.5 release and small improvements.
+3
View File
@@ -154,6 +154,7 @@ Weave Net is [available in Docker Store](https://store.docker.com/plugins/weave-
* 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 "_Save_"
* 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:
@@ -177,6 +178,8 @@ Weave Net is [available in Docker Store](https://store.docker.com/plugins/weave-
https://checkpoint-api.weave.works/admin
* File a PR to update the version of the daemonset at
https://github.com/kubernetes/kops/tree/master/upup/models/cloudup/resources/addons/networking.weave
and kops/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
and kops/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/manifest.yaml
## Troubleshooting
+1
View File
@@ -910,6 +910,7 @@ func (alloc *Allocator) donateSpace(r address.Range, to mesh.PeerName) {
alloc.debugln("Giving range", chunk, "to", to)
alloc.ring.GrantRangeToHost(chunk.Start, chunk.End, to)
alloc.persistRing()
alloc.gossip.GossipBroadcast(alloc.Gossip())
}
func (alloc *Allocator) assertInvariants() {
+3 -1
View File
@@ -565,7 +565,9 @@ func (r *Ring) Transfer(from, to mesh.PeerName) []address.Range {
for i, entry := range r.Entries {
if entry.Peer == from {
entry.Peer = to
entry.Version++
// bump version by large value so that transfer of range takes precedence (if there is any conflict in merging entry)
// over other opertaions on the entry that increments the version
entry.Version = entry.Version + 100
newRanges = append(newRanges, address.Range{Start: entry.Token, End: r.Entries.entry(i + 1).Token})
}
}
+7
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"net"
"os"
"strings"
"github.com/containernetworking/cni/pkg/ipam"
"github.com/containernetworking/cni/pkg/skel"
@@ -206,7 +207,13 @@ func (c *CNIPlugin) CmdDel(args *skel.CmdArgs) error {
err = ipam.ExecDel(conf.IPAM.Type, args.StdinData)
}
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf("Delete: no addresses for %s", args.ContainerID)) {
// ignore the error in the case where there are no IP addresses associated with container
fmt.Fprintln(os.Stderr, "weave-cni:", fmt.Sprintf("Delete: no addresses for %s", args.ContainerID))
return nil
}
logOnStderr(fmt.Errorf("unable to release IP address: %s", err))
return err
}
return nil
}
+6 -6
View File
@@ -96,33 +96,33 @@ func (cml *configMapAnnotations) GetAnnotation(key string) (string, bool) {
}
func (cml *configMapAnnotations) UpdateAnnotation(key, value string) (err error) {
if cml.cm == nil {
if cml.cm == nil || cml.cm.Annotations == nil {
return errors.New("endpoint not initialized, call Init first")
}
// speculatively change the state, then replace with whatever comes back
// from Update(), which will be the latest on the server whatever happened
// from Update(), which will be the latest on the server, or nil if error
cml.cm.Annotations[cleanKey(key)] = value
cml.cm, err = cml.Client.ConfigMaps(cml.Namespace).Update(cml.cm)
return err
}
func (cml *configMapAnnotations) RemoveAnnotation(key string) (err error) {
if cml.cm == nil {
if cml.cm == nil || cml.cm.Annotations == nil {
return errors.New("endpoint not initialized, call Init first")
}
// speculatively change the state, then replace with whatever comes back
// from Update(), which will be the latest on the server whatever happened
// from Update(), which will be the latest on the server, or nil if error
delete(cml.cm.Annotations, cleanKey(key))
cml.cm, err = cml.Client.ConfigMaps(cml.Namespace).Update(cml.cm)
return err
}
func (cml *configMapAnnotations) RemoveAnnotationsWithValue(valueToRemove string) (err error) {
if cml.cm == nil {
if cml.cm == nil || cml.cm.Annotations == nil {
return errors.New("endpoint not initialized, call Init first")
}
// speculatively change the state, then replace with whatever comes back
// from Update(), which will be the latest on the server whatever happened
// from Update(), which will be the latest on the server, or nil if error
for key, value := range cml.cm.Annotations {
if value == valueToRemove {
delete(cml.cm.Annotations, key) // don't need to clean this key as it came from the map
+11 -2
View File
@@ -115,7 +115,7 @@ func reclaimRemovedPeers(kube kubernetes.Interface, cml *configMapAnnotations, m
common.Log.Warnln("[kube-peers] not removing myself", peer)
continue
}
changed, err := reclaimPeer(weave, cml, storedPeerList, peer.PeerName, myPeerName)
changed, err := reclaimPeer(weave, cml, peer.PeerName, myPeerName)
if err != nil {
return err
}
@@ -135,11 +135,16 @@ func reclaimRemovedPeers(kube kubernetes.Interface, cml *configMapAnnotations, m
// actions the reclaim.
// Return a bool to show whether we attempted to change anything,
// and an error if something went wrong.
func reclaimPeer(weave weaveClient, cml *configMapAnnotations, storedPeerList *peerList, peerName string, myPeerName string) (changed bool, err error) {
func reclaimPeer(weave weaveClient, cml *configMapAnnotations, peerName string, myPeerName string) (changed bool, err error) {
common.Log.Debugln("[kube-peers] Preparing to remove disappeared peer", peerName)
okToRemove := false
nonExistentPeer := false
// Re-read status from Kubernetes; speculative updates may leave it un-set
if err := cml.Init(); err != nil {
return false, err
}
// 3. Check if there is an existing annotation with key X
existingAnnotation, found := cml.GetAnnotation(KubePeersPrefix + peerName)
if found {
@@ -148,6 +153,10 @@ func reclaimPeer(weave weaveClient, cml *configMapAnnotations, storedPeerList *p
if existingAnnotation == myPeerName {
okToRemove = true
} else {
storedPeerList, err := cml.GetPeerList()
if err != nil {
return false, err
}
// handle an edge case where peer claimed to own the action to reclaim but no longer
// exists hence lock persists foever
if !storedPeerList.contains(existingAnnotation) {
+2 -1
View File
@@ -137,9 +137,10 @@ func TestPeerListFuzz(t *testing.T) {
found := storedPeerList.contains(peerName(i))
require.True(t, found, "peer %d not found in stored list", i)
_, err = reclaimPeer(mockWeave{}, cml, storedPeerList, peerName(i), fmt.Sprintf("deleter-%d", i))
_, err = reclaimPeer(mockWeave{}, cml, peerName(i), fmt.Sprintf("deleter-%d", i))
require.NoError(t, err)
require.NoError(t, cml.Init())
storedPeerList, err = cml.GetPeerList()
require.NoError(t, err)
stateLock.Lock()
+5 -2
View File
@@ -209,10 +209,10 @@ ask for the logs like this:
$ kubectl logs -n kube-system weave-net-1jkl6 weave
```
For easier viewing, pipe the output into a file , especially if
For easier viewing, pipe the output into a file, especially if
it is long.
By default log level of `weave` container is set to `info` level. If you wish to see more detailed logs you can set the desired log level for the `-log-level` flag through the `EXTRA_ARGS` environment variable for the `weave` container in the weave-net daemon set. Add environment variable as below.
By default log level of `weave` container is set to `info` level. If you wish to see more detailed logs you can set the desired log level for the `--log-level` flag through the `EXTRA_ARGS` environment variable for the `weave` container in the weave-net daemon set. Add environment variable as below.
```yaml
containers:
@@ -224,6 +224,9 @@ By default log level of `weave` container is set to `info` level. If you wish to
value: --log-level=debug
```
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/)
-4
View File
@@ -110,10 +110,6 @@ func ObjectReaction(tracker ObjectTracker) testing.ReactionFunc {
}
err = tracker.Update(gvr, action.GetObject(), ns)
if err != nil {
if errors.IsConflict(err) { // return the currently-stored version of the object
obj, _ := tracker.Get(gvr, ns, objMeta.GetName())
return true, obj, err
}
return true, nil, err
}
obj, err := tracker.Get(gvr, ns, objMeta.GetName())