Commit Graph

410 Commits

Author SHA1 Message Date
Mike Lang
d55c528fe2 Revert "Merge pull request #2285 from weaveworks/mike/k8s-ns-in-container-view"
This reverts commit 76ddc75fb8, reversing
changes made to 3ade2933eb.

We are rolling this back for now because it's causing a bug where sub-topologies
would have ~3000 repeated cases of the k8s filters, causing performance issues clientside.
2017-03-17 14:00:05 -07:00
Mike Lang
76ddc75fb8 Merge pull request #2285 from weaveworks/mike/k8s-ns-in-container-view
When k8s present, allow filtering of containers by namespace
2017-03-16 14:56:10 -07:00
Mike Lang
b01e890475 When k8s present, allow filtering of containers by namespace
To facilitate this, we replace the existing functionality of updateFilters which
sets k8s topologies to have the filters [namespace, managed], to instead append the namespace filter
to any existing. This lets it apply to both k8s and container topologies without overwriting existing
container filters. We instead set the managed filter in the static definition.

This however has the side effect that the ordering of the namespace filter and the managed filter
in k8s topologies has been reversed, so it reads:
	Show Unmanaged | Hide Unmanaged
	foo | bar | default | baz | All Namespaces
instead of:
	foo | bar | default | baz | All Namespaces
	Show Unmanaged | Hide Unmanaged
2017-03-16 14:21:11 -07:00
Iago López Galeiras
9920c4ea48 Add eBPF connection tracking without dependencies on kernel headers
Based on work from Lorenzo, updated by Iago, Alban, Alessandro and
Michael.

This PR adds connection tracking using eBPF. This feature is not enabled by default.
For now, you can enable it by launching scope with the following command:

```
sudo ./scope launch --probe.ebpf.connections=true
```

This patch allows scope to get notified of every connection event,
without relying on the parsing of /proc/$pid/net/tcp{,6} and
/proc/$pid/fd/*, and therefore improve performance.

We vendor https://github.com/iovisor/gobpf in Scope to load the
pre-compiled ebpf program and https://github.com/weaveworks/tcptracer-bpf
to guess the offsets of the structures we need in the kernel. In this
way we don't need a different pre-compiled ebpf object file per kernel.
The pre-compiled ebpf program is included in the vendoring of
tcptracer-bpf.

The ebpf program uses kprobes/kretprobes on the following kernel functions:
- tcp_v4_connect
- tcp_v6_connect
- tcp_set_state
- inet_csk_accept
- tcp_close

It generates "connect", "accept" and "close" events containing the
connection tuple but also pid and netns.
Note: the IPv6 events are not supported in Scope and thus not passed on.

probe/endpoint/ebpf.go maintains the list of connections. Similarly to
conntrack, it also keeps the dead connections for one iteration in order
to report short-lived connections.

The code for parsing /proc/$pid/net/tcp{,6} and /proc/$pid/fd/* is still
there and still used at start-up because eBPF only brings us the events
and not the initial state. However, the /proc parsing for the initial
state is now done in foreground instead of background, via
newForegroundReader().

NAT resolution on connections from eBPF works in the same way as it did
on connections from /proc: by using conntrack. One of the two conntrack
instances is only started to get the initial state and then it is
stopped since eBPF detects short-lived connections.

The Scope Docker image size comparison:
- weaveworks/scope in current master:  22 MB (compressed),  68 MB
  (uncompressed)
- weaveworks/scope with this patchset: 23 MB (compressed), 69 MB
  (uncompressed)

Fixes #1168 (walking /proc to obtain connections is very expensive)

Fixes #1260 (Short-lived connections not tracked for containers in
shared networking namespaces)

Fixes #1962 (Port ebpf tracker to Go)

Fixes #1961 (Remove runtime kernel header dependency from ebpf tracker)
2017-03-08 22:11:12 +01:00
Filip Barl
2e9255b190 Addressed the comments and fixed the tests. 2017-02-20 11:40:40 +01:00
Filip Barl
f1904a626f Fix filtering issue for uncontained nodes in DNS name view (#2170). 2017-02-20 11:38:21 +01:00
Mike Lang
fad3e88269 Rename ECS Service node ids to be cluster;serviceName
This is important for two reasons:
* It prevents nasty false-equality bugs when two different services from different ECS clusters
  are present in the same report
* It allows us to retrieve the cluster and service name - all the info we need to look up the service -
  using only the node ID. This matters, for example, when trying to handle a control request.
2017-02-03 13:45:18 -08:00
Alfonso Acosta
0a135e6330 Check for known services before external IPs
Known services can be internal (e.g. same VPC in AWS)
2017-01-31 15:37:57 +00:00
Mike Lang
fca76d661e Merge pull request #2145 from weaveworks/mike/render/fix-ecs-detailed-parents
render.detailed: Add ECS topologies to detailed parents conversion
2017-01-23 13:23:45 -08:00
Mike Lang
19b6d5b1c4 Merge pull request #2146 from weaveworks/mike/render/fix-ecs-detailed-children
render.detailed: Teach detailed node view how to display ECS topologies as children
2017-01-23 13:23:27 -08:00
Mike Lang
eb44e95922 render.detailed: Teach detailed node view how to display ECS topologies as children
Previously, they were omitted.
2017-01-20 18:07:54 -08:00
Mike Lang
39e735f99e render.detailed: Add ECS topologies to detailed parents conversion
so they will correctly show up in the details view.
Currently, since ECS topologies aren't considered, the ECS parents of nodes are silently dropped.
2017-01-20 17:12:40 -08:00
Filip Barl
d3466b5454 Refactored the table component/model and wrote the tests
Backward-compatibility fix
2017-01-16 17:05:36 +01:00
Filip Barl
31be525bd2 Created generic table model on backend
Replaced MetadataRow with generic Row in Table model

Sending through multicolumn tables from the backend
2017-01-16 12:22:10 +01:00
Jonathan Lange
1020fc5f85 Use test.Diff from common 2016-12-07 11:22:40 +00:00
Jonathan Lange
e8085b01b6 Use 'common' library 2016-12-07 11:22:38 +00:00
Alfonso Acosta
f8b1f71f06 Finish rendering for ECS topologies 2016-11-29 07:18:08 -08:00
Alfonso Acosta
78775bbdb8 Initial rendering for ECS
(not working yet)
2016-11-29 07:18:05 -08:00
Filip Barl
d15e884cb1 Table-mode: sort ips numerically (#2007)
Fix #1746 - sort IPs numerically in the table mode
2016-11-22 11:05:59 +01:00
CarltonSemple
9833a854b1 Added container filters as CLI arguments
gofmt load_container_filters.go

removed the environment variable for container label filters

Added the --app.container-label-filter command line argument, and load_container_filters.go now uses the results from that

Changed init() to InitializeTopologies()

Changed init() to InitializeTopologies() so that it can be called after the container filters are loaded from the command line argument. init() executes before main() in prog/main.go, so the flag parsing isn't finished before init() is called

Applied lint fixes

fixed lint issues

brought back the init function for api_topologies.go

Addressed many of the PR comments, except escaping colons

Renamed IsDesired to HasLabel in render/filters.go

Allows for the user to escape colons

added registry function for modifying the container filters

created a separate function that parses the container filter flags

simplified registry.addContainerFilters()

addressed review comments

switched API Topology Description IDs to constants

addressed review comments

joined constants

added test functions

addressed most of the review comments

Changed containerLabelFilters to an array of APItopologyOptions, placing the parsing in the Set() function. Removed parsing from HasLabel in render/filters.go

refactored code

added test that applies to the container filtering by labels

applied golint

made Registry items private and added a MakeRegistry() function

fixed usage of topologyRegistry.RendererForTopology

Added container label filters by exclusion

minor update to report_fixture

Modified container labels test to use existing report

I added labels to the existing containers in the fixed report for testing.

refactored code

refactored code

further code refactoring

addressed @ijsnellf's review comments

unexported Registry, and reduced duplicate code

addressed @ijsnellf's review comments

Addressed review comments

Addressed final review comments
2016-11-15 19:13:35 +00:00
Alfonso Acosta
3af7076f30 Review feedback 2016-11-02 14:46:56 +00:00
Alfonso Acosta
d0e022050e Fix and extend tests 2016-11-02 13:16:12 +00:00
Alfonso Acosta
216cc0d605 Add image table to container nodes
Also, extend metadata of images with sizes
2016-11-02 13:16:11 +00:00
Alfonso Acosta
b458c4c0c8 Merge pull request #1182 from weaveworks/1132-weave-topology
Add the basics for a Weave-specific topology.
2016-10-28 12:23:55 +02:00
Alfonso Acosta
f906511ded Add initial metadata in details panel and clarification comments 2016-10-26 09:09:01 +00:00
Alfonso Acosta
3023f4be80 Add Weave summary generator and fix Weave renderer 2016-10-26 07:40:14 +00:00
Alfonso Acosta
e80a01aab9 Filter out docker overlay peers 2016-10-24 17:37:53 +00:00
Alfonso Acosta
8e4dfd7987 Add Weave peers view 2016-10-24 15:33:30 +00:00
Alfonso Acosta
529759b603 Discard short-lived connections to/from Pods in the host net 2016-10-21 14:42:44 +00:00
Alfonso Acosta
16ae11da77 Merge pull request #1922 from kinvolk/lorenzo/lint-untyped-keys
Fix linter errors on unkeyed fields
2016-10-20 11:32:59 +02:00
Simon
f6e81cf4d6 Merge pull request #1912 from weaveworks/1844-visually-duplicate-rows
Add label_minor to tooltips in connections table
2016-10-19 15:03:38 +02:00
Simon Howe
2ca23507de label_minor -> labelMinor, closer to all camelCase api 2016-10-19 10:50:11 +02:00
Lorenzo Manacorda
7ed139b15b fix linter errors on unkeyed fields 2016-10-14 12:53:48 +02:00
Simon Howe
bec4d281c3 Add label_minor to tooltips in connections table
Sometimes label is not enough to distinguish between rows.
2016-10-10 15:15:31 +02:00
Alfonso Acosta
5eabf5436c Make linter happy 2016-10-05 13:07:17 +00:00
Alfonso Acosta
3f27d5f6cc Do not filter out the target nodes when obtaining the details panel 2016-10-05 12:22:50 +00:00
Simon Howe
70681e4694 Fixes BE tests after exposing Truncate to the FE. 2016-09-28 12:18:12 +02:00
Matthias Radestock
5ce5d541d3 show forward DNS name for internet addresses
...if available.

Follow-up to #1863.
2016-09-22 21:01:44 +01:00
Simon Howe
685a895dd5 gofmt the go 2016-09-22 16:05:37 +02:00
Simon Howe
fe1ba9cc4d Tidying up connectionrow.dataType
- Rename DataType -> Datatype for consisitency
- Remove Datatype from connection.metadata
- Change UI to read dataType from connection.columns rather than from
  connection.metadata (col header rather than "cell")
2016-09-22 15:36:36 +02:00
Simon Howe
ac741a034e Fixes tests after numberifying columns 2016-09-21 16:38:01 +02:00
Simon Howe
7c4654d45c Fixes left alignment of numbers in the details panel tables
- By declaring more things to be numbers
- Also fixes initial sort direction of number columns from asc to desc.
2016-09-21 16:18:26 +02:00
Simon Howe
517110ba09 Keep "count" as tooltip for new mini "#" column header 2016-09-21 15:24:59 +02:00
Simon Howe
52362496b3 Rename connections."Count" => "#", flex remote column 2016-09-21 15:13:01 +02:00
Simon Howe
fc3fc72205 Fix ip column width in connections table, avoid truncating long ips 2016-09-21 10:01:42 +02:00
Alfonso Acosta
c64dfa6f55 Merge pull request #1863 from weaveworks/1082-nodes-for-known-services
Add pseudo-nodes for known services
2016-09-20 23:00:52 +02:00
Alfonso Acosta
c5ac315b38 Review feedback 2016-09-20 16:50:29 +00:00
Alfonso Acosta
193bfec50b Exclude ec2 since it's too generic 2016-09-19 14:45:22 +00:00
Alfonso Acosta
028ed32b6f Simplify service node matching 2016-09-19 14:38:59 +00:00
Alfonso Acosta
5c080ec062 Add pseudo-nodes for known services
AWS S3 and Dynamo to start with
2016-09-19 14:38:58 +00:00