Commit Graph

3963 Commits

Author SHA1 Message Date
Mike Lang
ec2a7fc753 Prefer controllers view for default view 2017-06-27 10:19:04 -07:00
Mike Lang
8eb72cf276 Remove deployment and daemonset views, change combined to controllers and remove bare pods and replica sets
Since we still need to map through replica sets to find matching deployments, we simply filter them out as a post-step.
2017-06-27 10:19:04 -07:00
Mike Lang
889972c48a Display node type on k8s controller nodes
Since there are multiple types in the same topology, displaying the type is important.
We do this in multiple places:

* Add node type to minor label

* Add node type as metadata and include in metadata template.
  Even though this will always be the same for every node of that topology, this was
  the easiest way to add it so it displays in the table view.
  Note we can't control ordering of columns in table view, it's always alphabetical.
2017-06-27 10:19:04 -07:00
jpellizzari
4f341cb1d2 Add new node shapes for k8s combined view
While we're there, adopt a consistent ordering for all places that shapes are listed
Order is least sides to most sides, with circle before polygons, and complex shapes (currently just Cloud) after.

On shape choices for topologies:
* Since the k8s logo is a heptagon, we want pods to be heptagons.
* Since triangle is 'a bit weird', we put it on the least-important type, replica sets.
* Pentagons look a little weirder than octogons (it's the lack of symmetry) so we put octogons on the most common (deployments)
2017-06-27 10:19:04 -07:00
Mike Lang
13b2ed69bd Improve renderer for combined view by refactoring Map2Parent
The existing technique of "reducing" the two rendered graphs for daemonsets and deployments
had a glaring issue that no connections would ever be made between nodes of different types,
since that information would've been discarded earlier in the process.
It also makes it hard to identify "parentless" pods.

This commit extends the Map2Parent function, teaching it:
	* To check multiple topologies for parents
	* To pass through nodes with no parents found without modification

Since we already had two 'modes' for what to do with nodes without parents,
and it would've been clunky to try to encode the third option into the existing PseudoNodeID
arg in some way, we instead split it into two args, with the first being an enum specifying
either the old pseudo node behaviour, the old drop behaviour, or the new keep behaviour.

We then use the new Map2Parent to map pods to:
	* A replica set, if it has one
	* A daemonset, if it has one
	* Itself, if neither of the above
and then map again from the results to any deployment, leaving as-is any nodes that
don't map to a deployment. Hence we are left with:
	* Deployments
	* Daemonsets
	* Replica sets, but only if they map to no deployment
	* Pods, but only if they map to none of the above
and connections between all these will be calculated correctly.
2017-06-27 10:19:04 -07:00
Mike Lang
d0cbf47c1c Add an option group to Combined view to select group type (daemonset or deployment)
This is a union set, so it will be suitable even as we continue to add more node types to this view.
2017-06-27 10:19:04 -07:00
Mike Lang
6dae014352 Add new view for 'combined' daemonset/deployment view
The idea is that this view shows all 'pods or groups of pods' at 'the highest level of abstraction'.
For now, we just show daemonsets and deployments.
2017-06-27 10:19:04 -07:00
Matthias Radestock
286e481771 Merge pull request #2645 from weaveworks/2644-initial-ebpf-polarity
correct polarity of initial connections

Fixes #2644.
2017-06-26 09:10:46 +01:00
Matthias Radestock
80790e44db Merge pull request #2639 from weaveworks/2638-connection-pid-pollution
ensure connections from /proc/net/tcp{,6} get the right pid

Fixes #2638.
2017-06-26 09:09:44 +01:00
Matthias Radestock
b43003fd2b refactor: remove superfluous pointering 2017-06-25 11:25:51 +01:00
Matthias Radestock
bd6cdc44a8 refactor: extract some common code 2017-06-25 11:22:32 +01:00
Matthias Radestock
181a548122 correct polarity of initial connections
Fixes #2644
2017-06-25 11:08:24 +01:00
Matthias Radestock
30e0444914 ensure connections from /proc/net/tcp{,6} get the right pid
ProcNet.Next does not allocate Connection structs, for efficiency.
Instead it always returns a *Connection pointing to the same instance.
As a result, any mutations by the caller to struct elements that
aren't actually set by ProcNet.Next, in particular Connection.Proc,
are carried across to subsequent calls.

This had hilarious consequences: connections referencing an inode
which we hadn't come across during proc walking would be associated
with the process corresponding to the last successfully looked up
inode.

The fix is to clear out the garbage left over from previous calls.

Fixes #2638.
2017-06-25 10:59:58 +01:00
Matthias Radestock
bc9e0e3364 Merge pull request #2641 from weaveworks/2640-no-weave-run
make integration tests pass with latest Weave Net release (2.0)

Fixes #2640.
2017-06-25 10:55:13 +01:00
Matthias Radestock
b2f14a96c5 refactor: extract a couple of test helpers 2017-06-25 10:27:49 +01:00
Matthias Radestock
30168c520e don't look for 'weaveproxy' - it no longer exists
... as of Weave Net 2.0
2017-06-25 08:08:09 +01:00
Matthias Radestock
6ef8281ad0 replace weave run with use of weave proxy
since Weave Net 2.0 removed `weave run`.
2017-06-25 08:08:09 +01:00
Alfonso Acosta
40bb28a450 Merge pull request #2637 from weaveworks/2636-DNSSnooper-race
Avoid race conditions in DNSSnooper's cached domains
2017-06-24 01:53:16 +02:00
Alfonso Acosta
4006040cc1 Review feedback 2017-06-23 23:52:30 +00:00
Matthias Radestock
7e3c8b8cef Merge pull request #2635 from weaveworks/color-connected-once
performance: only color connected once
2017-06-23 12:22:32 +01:00
Alfonso Acosta
9778be760b Use a global lock instead 2017-06-23 09:18:51 +00:00
Mike Lang
20754ffd37 Merge pull request #2633 from weaveworks/mike/fix-none-option
Fix issues with union types
2017-06-22 19:11:26 -07:00
Alfonso Acosta
22a31fc5f1 Review feedback 2017-06-22 16:33:36 +00:00
Alfonso Acosta
4139494783 Avoid race conditions in DNSSnooper's cached domains 2017-06-22 12:58:57 +00:00
Filip Barl
36ee5db1da Improved rendering order of nodes/edges in Graph View (#2623)
* Rendering both nodes and edges from one component.

* Organized the render layers in a more readable manner.

* Rerendering optimization.

* Finer edge rendering layers.

* Moved the constants out of the component file.

* Typo fix.

* Include edge thickness in <Motion /> instead of fade-in effect.
2017-06-22 11:58:31 +02:00
Matthias Radestock
d66b28de2a performance: only color connected once
ProcessRenderer was coloring connected nodes because we need that info
for rendering details panels. However, the main process topology view
renderers depending on ProcessRenderer were also doing coloring
themselves. For the 'processes' topology that was literally
duplicating work. For the 'processes-by-name' topology that was
throwing away the process coloring, and then coloring at the name
level.

Solution: remove the coloring from the ProcessRenderer, thus
eliminating the duplicate/thrown-away work, and introduce a
ColorConnectedProcessRenderer which is only used in places that
populate details panels.
2017-06-22 10:28:39 +01:00
Roland Schilter
6697e64889 Merge pull request #2624 from weaveworks/typo-doc-site-plugins
Fix typo in site/plugins.md
2017-06-22 10:44:28 +02:00
Mike Lang
0e54b27e81 Don't omitempty for option group default value
The value "" is meaningful, and the UI does not behave correctly if it's not present.
2017-06-21 15:17:07 -07:00
Mike Lang
383ace4d7e Replace 'none' id for the none option in union types with ''
In union option groups, the list of selected ids is encoded as a comma-delimited string.
For example, if 'foo' and 'bar' are selected, the value 'foo,bar' is sent, ie ["foo", "bar"] -> "foo,bar"
Under this scheme, with nothing selected, the empty string should be sent, ie. [] -> ""

Before this change, the frontend code called the "none option" by id 'none'.
There were several issues with this:
* The frontend would send 'none' when nothing was selected, not ''. The backend ignored this as it ignores
  junk values in the options, treating them as though they hadn't been given.
* The backend would attempt to set the default value of an option to "nothing selected", ie. [], by sending ''.
  The frontend would interpret this as nothing selected, *not even the 'none' option*, which caused a visual bug.
* Everything would break if one of the legitimate options had the id 'none', which could easily happen eg.
  if a user had a 'none' k8s namespace. This is perhaps an unusual name, but our code shouldn't break when
  a particular arbitary string is used as an input.

With this change, the none option is called '', which fixes all the above problems:
* The frontend encodes [''] as ''
* The frontend decodes '' as [''], and therefore shows the '' option as selected
* The string '' is not a valid k8s namespace name and is a reasonable "prohibited value" for all other use cases.
  The backend already couldn't handle a value with this id correctly prior to this change anyway.
2017-06-21 15:03:18 -07:00
Matthias Radestock
a7cfd043fc fix fmt string error in test, found by linter 2017-06-21 21:56:34 +01:00
Matthias Radestock
c6b114664f Merge pull request #2632 from weaveworks/extract-unmanaged-uncontained-prefix
refactor: extract a couple of heavily used constants
2017-06-21 21:48:24 +01:00
Matthias Radestock
8c6a171553 refactor: extract a couple of heavily used constants 2017-06-21 21:12:55 +01:00
Matthias Radestock
6b8a0e47e5 Merge pull request #2631 from weaveworks/2630-correct-nodeSummaryGroupSpec
correct `nodeSummaryGroupSpec`
2017-06-21 19:13:36 +01:00
Matthias Radestock
ae2a5edc18 make nodeSummaryGroupSpecs only include what's needed 2017-06-21 18:24:14 +01:00
Matthias Radestock
b6c886e0d1 cosmetic 2017-06-21 18:19:10 +01:00
Roland Schilter
454bb8aa93 Merge pull request #2626 from weaveworks/use-go183
Use latest go1.8.3
2017-06-21 16:37:55 +02:00
Roland Schilter
c1b56c81b7 Use latest go1.8.3 2017-06-21 14:41:51 +02:00
Matthias Radestock
ef003d8a79 Merge pull request #2625 from weaveworks/fast-network-membership-check
fast network membership check
2017-06-21 12:45:12 +01:00
Alfonso Acosta
845592b008 Merge pull request #2621 from weaveworks/2576-go-1.8
Use Go 1.8
2017-06-21 11:59:30 +02:00
Matthias Radestock
a306867610 fast network membership check
The rendering code checks whether endpoint IPs are part of
cluster-local networks. Due to the prevalence of endpoints - medium
sized reports can contain many thousands of endpoints - this is
performance critical. Alas the existing code performs the check via a
linear scan of a list of networks. That is slow when there are more
than a few, which will be the case in the context of k8s, since there
the probes register service IPs as local /32 networks.

Here we change representation of the set of networks to a prefix
tree (aka trie), which is well-suited for IP network membership checks
since networks are in fact a bitstring prefixes.

The specific representation is a crit-bit tree, but that choice was
purely based on implementation convenience - the chosen library is the
only one I could find that directly supports IP networks.
2017-06-21 03:03:49 +01:00
Alfonso Acosta
d5ad391721 Add build-essential package 2017-06-20 20:09:50 +00:00
Matthias Radestock
9e75331e9a Revert "fast network membership check"
This reverts commit 98f036359b.
2017-06-20 20:51:27 +01:00
Roland Schilter
fe98f6062c Fix typo in site/plugins.md 2017-06-20 21:47:30 +02:00
Matthias Radestock
4a54b75419 forgot this one in #2622 2017-06-20 20:43:26 +01:00
Matthias Radestock
98f036359b fast network membership check
The rendering code checks whether endpoint IPs are part of
cluster-local networks. Due to the prevalence of endpoints - medium
sized reports can contain many thousands of endpoints - this is
performance critical. Alas the existing code performs the check via a
linear scan of a list of networks. That is slow when there are more
than a few. Unfortunately in some common k8s network setups, e.g. on
AWS, a cluster can contain hundreds of networks, due to /32 networks
derived from interfaces with multiple IPs.

Here we change representation of the set of networks to a prefix
tree (aka trie), which is well-suited for IP network membership checks
since networks are in fact a bitstring prefixes.

The specific representation is a crit-bit tree, but that choice was
purely based on implementation convenience - the chosen library is the
only one I could find that directly supports IP networks.
2017-06-20 19:31:11 +01:00
Matthias Radestock
80c2b9d4f4 Merge pull request #2622 from weaveworks/ignore-ipv6
Ignore ipv6
2017-06-20 15:52:17 +01:00
Alfonso Acosta
1520444ab6 Use Go 1.8 2017-06-20 13:56:02 +00:00
Matthias Radestock
1ef56f6af6 refactor: extract common code 2017-06-20 12:03:02 +01:00
Matthias Radestock
7e5704b53b fix tests
...by removing them. It was a ridiculous amount of contorted code to
test some utterly trivial functionality that is largely provided by
the golang stdlib.
2017-06-20 12:03:02 +01:00
Filip Barl
eb64d3f09b Make API calls with time travel timestamp (#2600)
* Node details fetching reports at proper timestamp.

* Corrected all the relevant timestamps in the UI.

* Renamed some state variables.

* Time travel works for topologies list.

* Added a whole screen overlay for time travel.

* Polished the backend.

* Make time travel work also with the Resource View.

* Fixed the jest tests.

* Fixed the empty view message for resource view.

* Some naming polishing.

* Addressed the comments.
2017-06-20 12:31:22 +02:00