Commit Graph

69 Commits

Author SHA1 Message Date
Oliver Gould f80f3892a0
proxy: bump version for bug fixes (#1935)
* 0065c137 profiles: Drive profile discovery on a daemon task (#156)
* b9ffbb7f Update h2 to v0.1.14
* 3ac6b72c Add basic tap integration tests (#154)
2018-12-05 13:23:26 -08:00
Oliver Gould ffa302eb6a
proxy: Update for debug logging (#1922)
commit 68f42c337f2580f3b33ddab2e01540f6849d0d1a (HEAD -> master, origin/master)
Author: Oliver Gould <ver@buoyant.io>
Date:   Tue Dec 4 07:45:20 2018 -0800

    Log discovery updates in the outbound proxy (#153)

    When debugging issues that users believe is related to discovery, it's
    helpful to get a narrow set of logs out to determine whether the proxy
    is observing discovery updates.

    With this change, a user can inject the proxy with
    ```
    LINKERD2_PROXY_LOG='warn,linkerd2_proxy=info,linkerd2_proxy::app::outbound::discovery=debug'
    ```
    and the proxy's logs will include messages like:

    ```
    DBUG voting-svc.emojivoto.svc.cluster.local:8080 linkerd2_proxy::app::outbound::discovery adding 10.233.70.98:8080
    DBUG voting-svc.emojivoto.svc.cluster.local:8080 linkerd2_proxy::app::outbound::discovery removing 10.233.66.36:8080
    ```

    This change also turns-down some overly chatty INFO logging in main.
2018-12-04 12:13:45 -08:00
Oliver Gould baa7436cc7
Bump the proxy version to fix integration tests (#1914)
A Tap integration test fails and has been fixed by
linkerd/linkerd2-proxy#152.

This change bumps the proxy version to get this change, as well as an
upgrade to the `h2` library for bugfixes.
2018-12-03 16:30:35 -08:00
Oliver Gould 926395f616
tap: Include route labels in tap events (#1902)
This change alters the controller's Tap service to include route labels
when translating tap events, modifies the public API to include route
metadata in responses, and modifies the tap CLI command to include
rt_ labels in tap output (when -o wide is used).
2018-12-03 13:52:47 -08:00
Alex Leong 73836f05cf
Update proxy version and use canonicalized dst (#1866)
The `linkerd` routes command only supports outbound metrics queries (i.e. ones with the `--from` flag).  Inbound queries (i.e. ones without the `--from` flag) never return any metrics.

We update the proxy version and use the new canonicalized form for dst labels to gain support for inbound metrics as well.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-11-26 17:20:07 -08:00
Dennis Adjei-Baah 214540c823
Add new iptable rule to for outbound traffic (#1863)
When requests from a pod send requests to itself, the proxy properly redirects traffic from the originating container in the pod through the outbound listener of the proxy. Once the request ends on the inbound side of the proxy, it skips the proxy and calls the original container that made the request. This can cause problems for containers that serve HTTP as the proxy naively tries to initiate an HTTP/2 connection to the destination of a request.  (See #1585 for a concrete example)

This PR adds a new iptable rule, coupled with a proxy [change](https://github.com/linkerd/linkerd2-proxy/pull/122) ensure that requests from a that occur in the aforementioned scenario, always redirect to the inbound listener of the proxy first.

fixes #1585

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-11-15 13:56:45 -08:00
Dennis Adjei-Baah dfaf3b1e1b
bump proxy version to 5e0a15b (#1842)
Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2018-11-06 13:20:52 -08:00
Oliver Gould 557dca5a56
Upgrade to linkerd/linkerd2-proxy#f97239ba (#1829)
This change updates the proxy version to fix grpc failure
classification, per #1819.
2018-10-30 15:19:01 -07:00
Kevin Lingerfelt 07c861e39f
Revert proxy upgrade (#1818)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-10-26 15:42:37 -07:00
Kevin Lingerfelt c59f43d827
Bump proxy version to latest master (#1815)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-10-26 13:49:03 -07:00
Risha Mars 5280ecbf40
Use jest instead of karma for running tests (#1768)
Jest is faster, has more flexibility to run a subset of the tests, and will allow 
us to remove a bunch of our assertion libraries.

Many thanks to @grampelberg for prior work on this (#1000)

This PR:
- changes the test runner from karma to jest
- moves individual tests from /test/ to/js/components` where jest expects them
2018-10-15 17:06:35 -07:00
Alex Leong f1f5b49f59
Add generated Kubernetes client for ServiceProfile custom resource (#1752)
To support reading and writing of the ServiceProfile custom resource, we add a codegen'd Kubernetes client for this resource.

* Adding the ServiceProfile type and related boilerplate to /controller/gen/apis/serviceprofile. This boilerplate also contains directives that control how codegen works.
* A script in /hack which invokes codegen that generates Kubernetes client machinery for interacting with ServiceProfile resources. The majority of the generated code lives in /controller/gen/client.
* The above-mentioned generated code.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-10-11 11:43:35 -07:00
Eliza Weisman d4d4e557e9
Update pinned proxy SHA to latest master (#1754)
This PR updates the proxy SHA the build is pinned. This is in order to
track dependency updates in the proxy for the upcoming edge release.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-10-10 14:01:36 -07:00
Alex Leong db37c5a007
Pin the proxy version to a SHA (#1746)
Pin the proxy version to a specific SHA instead of floating on latest.  This allows breaking changes in the proxy repo to not break the main Linkerd 2 repo.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-10-09 14:22:39 -07:00
Andrew Seigner dccccebd79
Add LICENSE files to all Docker images (#1727)
To comply with certain environments, include our LICENSE file in all
Docker images.


Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-10-02 16:25:52 -07:00
Kevin Lingerfelt 7c07ba0d53
Upgrade to dep 0.5.0, go 1.10.3 (#1479)
* Upgrade to dep 0.5.0, go 1.10.3
* Remove existing dep binary if it's the wrong version
* Add version in filename of dep binary to prevent version conflicts

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-08-17 16:04:50 -07:00
Kevin Lingerfelt 7530b92abb
Add script to extract binaries from prebuilt cli-bin image (#1388)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-31 15:56:35 -07:00
Brian Smith 7467e36b28
bin/test-cleanup: Delete test namespaces in paralllel. (#1339)
* bin/test-cleanup: Delete test namespaces in paralllel.

My kubectl (1.9.4) waits until the `kubectl delete` operation completes,
unlike previous versions which issue the deletion request and then
immediate return. As a result of this change, bin/test-cleanup become
much slower since each deletion was happening serially. Fix this by
issuing all the deletions in parallel with a single `kubectl delete`.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-27 10:43:49 -10:00
Brian Smith 377391cda9
Fix build on Linux. (#1372)
Without this change the Linux build fails. Apparently
commit 554ffe6a46 added the use of a
bash-specific feature.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-27 07:06:35 -10:00
Kevin Lingerfelt dae86da0e4
Allow docker-build-proxy to override the proxy version (#1324)
* Allow docker-build-proxy to override the proxy version
* Update based on review feedback
* fetch-proxy should return full path to executable

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-26 10:10:49 -07:00
Kevin Lingerfelt 554ffe6a46
Build version tags in CI (#1365)
* Build version tags in CI
* Simplify clean_head method

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-25 12:32:42 -07:00
Kevin Lingerfelt 37f8490edb
Update top-level docs to reflect repo rename (#1333)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-17 13:42:25 -07:00
Brian Smith 0fcfd2bffb
Stop using `installsuffix` when building Go code. (#1327)
* Stop using `installsuffix` when building Go code.

See https://plus.google.com/117192131596509381660/posts/eNnNePihYnK.
`-installsuffix cgo` isn't necessary as of Go 1.10 (where build caching
changed substantially) and it probably wasn't necessary earlier.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-16 13:48:50 -10:00
Brian Smith 3c29356bad
Fix file permissions for bin/fast-build. (#1326)
Revert the file permission changes from
commit f79a40a3e1.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-13 15:58:45 -10:00
Brian Smith f79a40a3e1
Add flag that skips `dep ensure` to bin/fast-build (#1321)
* Add flag that skips `dep ensure` to bin/fast-build

bin/fast-build is supposed to be fast. `dep ensure -vendor-only` is too slow
to meet this goal. Add `LINKERD_SKIP_DEP` to allow skipping it. The default
behavior is kept as-is to reduce new users' confusion.

The difference in speed isn't too notable now because the bin/docker-build
step drowns out the win currently. But if/when the bin/docker-build step is
replaced, this matters a lot.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-07-13 14:58:35 -10:00
Kevin Lingerfelt e5cce1abaf
Rename CLI from conduit to linkerd (#1312)
* Rename CLI binary
* Update integration tests for new binary name
* Rename --conduit-namespace flag, change default ns
* Rename occurrences of conduit in rest of CLI
* Rename inject and install components
* Remove conduit occurrences in docker files
* Additional miscellaneous cleanup
* Move protobuf definitions to linkerd2 package
* Rename conduit.io labels to use linkerd.io
* Rename conduit-managed segment to linkerd-managed
* Fix conduit references in web project

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-12 17:14:07 -07:00
Andrew Seigner e18fa48135
Name ClusterRole objects to be namespace-specific (#1295)
The control-plane's `ClusterRole` and `ClusterRoleBinding` objects are
global. Because their names did not vary across multiple control-plane
deployments, it prevented multiple control-planes from coexisting (when
RBAC is enabled).

Modify the `ClusterRole` and `ClusterRoleBinding` objects to include the
control-plane's namespace in their names. Also modify the integration
test to first install two control-planes, and then perform its full
suite of tests, to prevent regression.

Fixes #1292.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-07-10 16:21:20 -07:00
Oliver Gould 941cad4a9c
Migrate build infrastructure to linkerd2 (#1298)
This PR begins to migrate Conduit to Linkerd2:
* The proxy has been completely removed from this repo, and is now located at
  github.com/linkerd/linkerd2-proxy.
* A `Dockerfile-proxy` has been added to fetch the most-recently published proxy
  binary from build.l5d.io.
* Proxy-specific protobuf bindings have been moved to
  github.com/linkerd/linkerd2-proxy-api.
* All docker images now use the gcr.io/linkerd-io registry.
* `inject` now uses `LINKERD2_PROXY_` environment variables
* Go paths have been updated to reflect the new (future) repo location.
2018-07-09 15:38:38 -07:00
Kevin Lingerfelt 693acdbf26
Update ListPods endpoint to return all pod owner types (#1275)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 15:14:16 -07:00
Kevin Lingerfelt d42d7cb035
Re-run install integration test w/TLS enabled (#1230)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-07-05 10:32:29 -07:00
Oliver Gould 20276b106e
tap: Support `tls` labeling (#1244)
The proxy's metrics are instrumented with a `tls` label that describes
the state of TLS for each connection and associated messges.

This same level of detail is useful to get in `tap` output as well.

This change updates Tap in the following ways:
* `TapEvent` protobuf updated:
  * Added `source_meta` field including source labels
  * `proxy_direction` enum indicates which proxy server was used.
* The proxy adds a `tls` label to both source and destination meta indicating the state of each peer's connection
* The CLI uses the `proxy_direction` field to determine which `tls` label should be rendered.
2018-07-02 17:19:20 -07:00
Andrew Seigner c4d570aa26
Revert usage of parallel in docker-build (#1183)
PR #978 introduced usage of parallel in docker-build. Unfortunately this
breaks if the system has non-GNU parallel.

Remove usage of parallel until we can do at least one of the following:
- detect version of parallel installed
- make usage of parallel optional and off by default
- confirm this speeds up builds for a majority of use cases

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-06-21 23:13:29 +01:00
Eliza Weisman 9bf1e60a61 bin: Remove unused script (#1153)
Committed in error.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-20 18:01:14 -07:00
Thomas Rampelberg ad659874bd
Enable optional parallel build of docker images (#978)
* Enable optional parallel build of docker images

By default, docker does image builds in a single thread. For our containers, this is a little slow on my system. Using `parallel` allows for *optional* improvements in speed there.

Before: 41s
After: 22s

* Move parallel help text to stderr
2018-06-20 15:57:29 -07:00
Kevin Lingerfelt 4278f9ec80
Fix unbound variable issue in docker-build script (#1146)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-18 11:29:09 -07:00
Alena Varkockova 6bb8b1328f Build CLI only for host platform (#884)
* Build CLI only for host platform

Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>

* Changes after code review

Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
2018-06-18 10:34:56 -07:00
Kevin Lingerfelt a68ca736fa
Start running integration tests in CI (#1064)
* Start running integration tests in CI
* Add gcp helper funcs
* Split integration test cleanup into separate phase

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-06-15 14:36:48 -07:00
Eliza Weisman 0eadcc542e
proxy: Fix Inotify falling back to polling when files don't exist yet (#1119)
This PR changes the proxy's Inotify watch code to avoid always falling back to
polling the filesystem when the watched files don't exist yet. It also contains
some additional cleanup and refactoring of the inotify code, including moving
the non-TLS-specific filesystem watching code out of the `tls::config` module
and into a new `fs_watch` module.

In addition, it adds tests for both the polling-based and inotify-based watch
implementations, and changes the polling-based watches to hash the files rather
than using timestamps from the file's metadata to detect changes. These changes
are originally from #1094 and #1091, respectively, but they're included here
because @briansmith asked that all the changes be made in one PR.

Closes #1094. Closes #1091. Fixes #1090. Fixes #1097. Fixes #1061.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-15 11:40:04 -07:00
Oliver Gould 2a4f38b9e7
proto: Use explicit `go_package` option (#1120)
protobuf has a `go_package` option that can be used to explicitly name
Go packages such that they can be imported without additional rewrites.

This allows us to store proto files without additional, redundant
directories (which were used for packaging hints, previously).

This change adds an explicit `go_package` to all .proto files and
updates `bin/protoc-go.sh` to ensure these packages are output into
$GOPATH (so that the go_package can be absolute). This removes the need
to manually rewrite imports in bin/protoc-go.sh.
2018-06-14 14:03:00 -07:00
Eliza Weisman 65585699b6
Fix unbound `DOCKER_TRACE` var in `bin/docker-test-proxy` (#1107)
I forgot to export this since the script no longer sources `. bin/_docker.sh`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-12 13:19:14 -07:00
Eliza Weisman b7399f484a
Add a script for running proxy tests in Docker (#1102)
When developing features in the proxy, that rely on Linux-only OS features,
developers using other operating systems may find it inconvenient to test
their changes. While we run CI builds on Linux, and may have access to Linux
testing environments, this is not as tightly integrated into the proxy 
development workflow as running a quick `cargo test` on the host OS.

For example, I found it inconvenient to test the `inotify` based filesystem
watch code I've been adding in recent commits, and had to do things like
opening a WIP PR for a branch to get CI to run the tests. This workflow is not
ideal.

This PR adds an (admittedly somewhat hacky) script and Dockerfile for running
the proxy's tests in Docker. This accomplishes approximately the same goal as 
the `PROXY_SKIP_TESTS` flag that we used to have, but with the advantage that 
we no longer include the test dependencies in release builds. 

Of course, this also means that we no longer share any of the dependencies 
between the test docker build and the release docker build, which is a shame. 
It might be worthwhile to re-introduce a dependencies image so that cached
builds of the proxy's dependencies can be shared between the test and release
Dockerfiles. However, I thought that deserved to be discussed separately from
the changes I made in this branch.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-06-11 16:44:39 -07:00
Thomas Rampelberg 9889597c29
Handle an edge case when using bin/web (#1075)
* Handle an edge case when using bin/web

There's a weird error running `bin/web dev` if you don't have conduit installed on a kubernetes cluster. Nothing in the docs mention that you need to work on this.

Output a user friendly error when we can't find a pod and update the docs to remind folks to install conduit first. Fixes #1070

* Wrap text, send to stderr, fail when missing
2018-06-06 16:44:28 -07:00
Kevin Lingerfelt cb2415498f
Update web dockerfile to use dev deps when building prod assets (#985)
* Update web dockerfile to use dev deps when building prod assets
* Don't re-run yarn install as pre-req for build/run/test

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-05-23 10:31:53 -07:00
Thomas Rampelberg d0f0eecbc8
Fix the web docker build by running yarn outside of NODE_ENV=production (#988)
As part of trying to be fancy, I moved the `setup` step into build. This breaks the docker builds because we need to run yarn *without* NODE_ENV=production and then the build *with* NODE_ENV=production (to do things like minify/compress assets).

Split apart build as something without setup and provide a default target that does setup + build for travis.
2018-05-23 10:05:27 -07:00
Thomas Rampelberg c5f0adafc8
Update babel to use `env` and `react-app` as presets. (#976)
- Switched from `es2015` to `env` for the default preset. This is the recommended preset and allows us to track the latest and greatest moving forward.
- Added `react-app` as a preset. We get class properties (and thus => for context) as well as the current recommended settings for react apps.
- Created a `web` script that provides functions for common tasks. `react-app` requires that BABEL_ENV/NODE_ENV is set and this guarantees it.
- Updated the web dockerfile to set NODE_ENV correctly and use `bin/web`.
- Moved the babel related modules over to devDependencies.
2018-05-22 17:17:44 -07:00
Oliver Gould e5ad5de975
Reuse the proxy's build stage across CI runs (#891)
The proxy's Dockerfile is split into stages: build and runtime.
The build stage includes all of the intermdiate build information, and
the runtime image discards these layers with a small production-ready
image.

In order to improve docker build times, we can save this build layer to
be reused.

This reduces the docker build of the proxy in CI from 15 minutes to
about 7.5 minutes (when the proxy is not changed).
2018-05-09 09:11:58 -07:00
Oliver Gould 1801118906
Do not run tests in proxy Dockerfile (#882)
The proxy Dockerfile includes test execution. While the intentions of
this are good, it has unintended consequences: we can ship code linked
with test dependencies.

Because we have other means for testing proxy code (cargo, locally; and
CI runs tests outside of Docker), it is fine to remove these tests.
2018-05-01 11:54:02 -07:00
Kevin Lingerfelt fb15fe7c1a
Remove the telemetry service (#757)
* Remove the telemetry service

The telemetry service is no longer needed, now that prometheus scrapes
metrics directly from proxies, and the public-api talks directly to
prometheus. In this branch I'm removing the service itself as well as
all of the telemetry protobuf, and updating the conduit install command
to no longer install the service. I'm also removing the old version of
the stat command, which required the telemetry service, and renaming the
statsummary command to stat.

* Fix time window tests

* Remove deprecated controller scrape config

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-04-13 11:21:29 -07:00
Andrew Seigner 9508e11b45
Build conduit-specific Grafana Docker image (#679)
Using a vanilla Grafana Docker image as part of `conduit install`
avoided maintaining a conduit-specific Grafana Docker image, but made
packaging dashboard json files cumbersome.

Roll our own Grafana Docker image, that includes conduit-specific
dashboard json files. This significantly decreases the `conduit install`
output size, and enables dashboard integration in the docker-compose
environment.

Fixes #567
Part of #420

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-04-05 14:20:05 -07:00
Kevin Lingerfelt 59c75a73a9
Add tests/utils/scripts for running integration tests (#608)
* Add tests/utils/scripts for running integration tests

Add a suite of integration tests in the `test/` directory, as well as
utilities for testing in the `testutil/` directory.

You can use the `bin/test-run` script to run the full suite of tests,
and the `bin/test-cleanup` script to cleanup after the tests.

The test/README.md file has more information about running tests.

@pcalcado, @franziskagoltz, and @rmars also contributed to this change.

* Create TEST.md file at the root of the repo

* Update based on review feedback

* Relax external service IP timeout for GKE

* Update TEST.md with more info about different types of test runs

* More updates to TEST.md based on review feedback

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-03-27 15:06:55 -07:00