Commit Graph

1316 Commits

Author SHA1 Message Date
Andrew Seigner db747eec8a
Retroactively update edge-19.2.1 release notes (#2259)
edge-19.2.1 included a breaking change related to the namespace where
`ServiceProfile`s are defined.

This change updates the release notes for that release to indicate the
breaking change.

Relates to linkerd/website#156

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-02-11 16:39:07 -08:00
Carol A. Scott e1cead1c4e
Clicking Linkerd logo on web UI redirects to /overview (#2253)
Fixes #2232

The Linkerd logo on the top left of the web UI is now wrapped in a
`react-router-dom` Link component so that clicking it redirects to `/overview`.
2019-02-11 13:18:10 -08:00
Kevin Lingerfelt 4a5152e9e3
Update CHANGES.md for edge-19.2.2 release (#2251)
* Update CHANGES.md for edge-19.2.2 release

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-11 12:58:20 -08:00
Oliver Gould 8a8ee649c5
proxy: Log canonicalization warnings on only the first error (#2250)
commit 59d00f69653730353ec246b8cb2eb39d80a54d3e
Author: Oliver Gould <ver@buoyant.io>
Date:   Mon Feb 11 10:51:37 2019 -0800

    Log canonicalization warnings on only the first error (#189)

    When a canonicalization task fails to resolve a name, our logging is not
    particularly clear about the current state of the stack. Specifically,
    it's difficult to know whether the stack has resolved the name
    successfully before.

    With this change, canonicalization failures are logged (at warning, not
    error) only when the task has not previously resolved a name.
    Subsequent errors are now logged at the debug level (instead of
    warning).
2019-02-11 12:52:09 -08:00
Alejandro Pedraza 4dc204ae51
Honour install's `proxy-log-level` flag when autoinjecting proxies (#2249)
Fixes #2248

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-02-11 14:23:09 -05:00
Kevin Lingerfelt 26aa771482
Fix auto-inject config when TLS is disabled (#2246)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-11 11:01:18 -08:00
Andrew Seigner 1a60237a94
Update check command hint URLs to new alias (#2245)
The existing hint URLs printing by `linkerd check` pointed to locations
that would change if the linkerd.io website was reorganized.

linkerd/website#148 introduces an alias for hint URLs at
https://linkerd.io/checks/. This is the corresponding change to update
`linkerd check` output.

Depends on linkerd/website#148, relates to linkerd/website#146.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-02-11 11:00:16 -08:00
Alex Leong 3f333c2860
Validate service profiles in all namespaces (#2237)
Fixes #2220 

The service profile validation which is part of `linkerd check` only validates service profiles in the Linkerd namespace.  Due to a recent change, service profiles now can exist in any namespace.

Update the logic so that service profiles in all namespaces are validated.  
Additionally:
* Relax validation of service profile names to support external names

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-02-11 09:52:47 -08:00
Ivan Sim f6e75ec83a
Add statefulsets to the dashboard and CLI (#2234)
Fixes #1983

Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-02-08 15:37:44 -08:00
Alex Leong 030767d615
Refactor fallback profile listener to avoid repetition (#2228)
Refactor fallback profile listener to avoid repetition

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-02-08 14:24:10 -08:00
Kevin Lingerfelt 5ef8f4da44
Bump lodash dependency to fix security warning (#2235)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-08 13:09:27 -08:00
Kevin Leimkuhler 19120d332d
Add release notes for edge-19.2.1 (#2230)
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2019-02-07 16:40:34 -08:00
Carol A. Scott c38d323b05
Replacing lodash filter with native filter to avoid additional import (#2229)
@rmars and I set out to replace all instances of lodash filter with native
filter in order to prevent the additional import. However, there was only one
use of _filter that could be easily replaced, since our other uses depend on
lodash's ability to handle empty variables, and the ability to filter both
objects and arrays (JS's native filter is only for arrays). Switching to native
filter in those cases would have required us to manually check the value of the
variable, set it to an empty array and/or convert it from an object to an array.

Signed-off-by: Carol Scott <carol@buoyant.io>
2019-02-07 16:31:46 -08:00
Alejandro Pedraza 1ef25390ec
GetPodsFor() called for an ExternalName service shouldn't return any pods (#2226)
Running `linkerd routes` for some resource was returning, besides the data for the resource, additional rows for each `ExternalName` service in the namespace.

Fixes #2216

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-02-07 18:17:36 -05:00
Alex Leong 5b054785e5
Read service profiles from client or server namespace instead of control namespace (#2200)
Fixes #2077 

When looking up service profiles, Linkerd always looks for the service profile objects in the Linkerd control namespace.  This is limiting because service owners who wish to create service profiles may not have write access to the Linkerd control namespace.

Instead, we have the control plane look for the service profile in both the client namespace (as read from the proxy's `proxy_id` field from the GetProfiles request and from the service's namespace.  If a service profile exists in both namespaces, the client namespace takes priority.  In this way, clients may override the behavior dictated by the service.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-02-07 14:51:43 -08:00
Andrew Seigner 907f01fba6
Improve ServiceProfile validation in linkerd check (#2218)
The `linkerd check` command was doing limited validation on
ServiceProfiles.

Make ServiceProfile validation more complete, specifically validate:
- types of all fields
- presence of required fields
- presence of unknown fields
- recursive fields

Also move all validation code into a new `Validate` function in the
profiles package.

Validation of field types and required fields is handled via
`yaml.UnmarshalStrict` in the `Validate` function. This motivated
migrating from github.com/ghodss/yaml to a fork, sigs.k8s.io/yaml.

Fixes #2190
2019-02-07 14:35:47 -08:00
Andrew Seigner 72812baf99
Introduce Discovery API and endpoints command (#2195)
The Proxy API service lacked introspection of its internal state.

Introduce a new gRPC Discovery API, implemented by two servers:
1) Proxy API Server: returns a snapshot of discovery state
2) Public API Server: pass-through to the Proxy API Server

Also wire up a new `linkerd endpoints` command.

Fixes #2165

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-02-07 14:02:21 -08:00
Dennis Adjei-Baah e98ba06e5f
Modify klog to be verbose when controller log-level is set to debug (#2221)
The controller logs innocuous messages when control plane proxies aren't ready to route requests during startup from each control plane component. i.e. tap, public-api and proxy-api. Setting the log level in the control plane to `INFO` would not hide these log messages and would still show up on control plane startup.

This PR modifies `klogs` initial flag set to route innocuous logs to `/dev/null` if the controller log level is set to INFO. If set to debug, we output all loglines to stderr.

Fixes #2171 #2168
Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2019-02-07 13:48:42 -08:00
Cody Vandermyn 74eac764d8 CNI: Removed unnecessary tolerations; added created-by annotation. (#2222)
Removed unnecessary tolerations; added created-by annotation.

Signed-off-by: Cody Vandermyn <cody.vandermyn@nordstrom.com>
2019-02-07 13:36:00 -08:00
Kevin Leimkuhler 9cca1df3b6
Proxy: bump pinned version to 7add4fc (#2225)
* Remove destination address from endpoint metric labels
(linkerd/linkerd2#187)
* Set proxy_id in calls to Get and GetProfile (linkerd/linkerd2#183)
* Add l5d-client-id on inbound requests if meshed TLS (linkerd/linkerd2#184)

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2019-02-07 12:17:51 -08:00
Kevin Lingerfelt a11b9933fc
Update auto-injector to require opt-in by namespace or pod (#2209)
* Update auto injector to require opt-in by namespace or pod
* Rename namespace fixtures

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-06 17:37:14 -08:00
Risha Mars e531655d26
Add a --tap flag to the linkerd profile command (#2139)
Adds the ability to generate a service profile by running a tap for a configurable 
amount of time, and using the route results from the routes seen during the tap.

e.g. `linkerd profile web --tap deploy/web -n emojivoto --tap-duration 2s`
2019-02-06 12:43:16 -08:00
Alejandro Pedraza 50fbcc60b5
Add support for `basePath` in swagger 2.0 files (#2211)
Fixes #2175

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-02-06 13:44:35 -05:00
Alejandro Pedraza 79b875a1e8
If GOPATH env var not set, use build.Default.GOPATH (#2215)
Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-02-06 13:23:48 -05:00
Alejandro Pedraza 0b42a02bb9
Build request urls in the most generic possible way (#2206)
Build request urls in the most generic possible way

Fixes #2132

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-02-06 13:22:17 -05:00
Kevin Lingerfelt 02f128ec5a
Reorganize install/inject config structs (#2202)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-05 12:50:42 -08:00
Alejandro Pedraza 2a7654ce78
Consolidate timeouts for `linkerd check` (#2191)
Consolidate timeouts for `linkerd check`

- Moved the creation of contexts from inside the methods targeted by the
checks into a single place in the runCheck() and runCheckRPC() methods
where the context is built using a hard-coded timeout of 30 seconds.
- k8s' client-go doesn't allow passing along contexts, but it let's us
setting the Timeout manually.
- Reworded the description for the --wait option.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-02-05 11:38:30 -05:00
Kevin Leimkuhler 66070c26f4
Introduce go generate to embed static templates (#2189)
# Problem
In order to switch Linkerd template rendering to use `.yaml` files, static
assets must be bundled in the Go binary for use by `linkerd install`.

# Solution
The solution should not affect the local development process of building and
testing.

[vfsgen](https://github.com/shurcooL/vfsgen) generates Go code that statically
implements the provided `http.FileSystem`. Paired with `go generate` and Go
[build tags](https://golang.org/pkg/go/build/), we can continue to use the
template files on disk when developing with no change required.

In `!prod` Go builds, the `cli/static/templates.go` file provides a
`http.FileSystem` to the local templates. In `prod` Go builds, `go generate
./cli` generates `cli/static/generated_templates.gogen.go` that statically
provides the template files.

When built with `-tags prod`, the executable will be built with the staticlly
generated file instead of the local files.

# Validation
The binaries were compiled locally with `bin/docker-build`. The binaries were
then tested with `bin/test-run (pwd)/target/cli/darwin/linkerd`. All tests
passed.

No change was required to successfully run `bin/go-run cli install`. No change
was required to run `bin/linkerd install`.

Fixes #2153

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2019-02-04 18:09:47 -08:00
Oliver Gould 44e31f0f67
Configure proxy keepalives via the environment (#2193)
In linkerd/linkerd2-proxy#186, the proxy supports configuration of TCP
keepalive values.

This change sets `LINKERD2_PROXY_INBOUND_ACCEPT_KEEPALIVE` and
`LINKERD2_PROXY_OUTBOUND_CONNECT_KEEPALIVE` to 10s when injecting the
proxy, so that remote connections are configured with a keepalive.

This configuration is NOT yet exposed through the CLI. This may be done
in a followup, if necessary.

Fixes #1949
2019-02-04 16:16:43 -08:00
Oliver Gould 4798ad3f44
Use the proper controller identity when configuring pods with TLS (#2196)
Since 37ae423, deployments have been prefixed with linkerd-; however
the inject logic was not changed to take this into consideration when
constructing the controller's identity.

This means that the proxy's client to the control plane has been unable to
establish TLS'd communcation to the proxy-api. Previously, the proxy would
silently fall back to plaintext, but in master this behavior recently changed to
be stricter, so this bug will prevent the proxy from connecting to proxy-api
in any way.
2019-02-04 14:59:03 -08:00
Andrew Seigner 3a139d0202
Fix spelling on linkerd check link (#2197)
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-02-04 14:00:11 -08:00
Ye Ben f2ba17d366 fix some typos (#2194)
Signed-off-by: yeya24 <ben.ye@daocloud.io>
2019-02-02 23:03:54 -08:00
Kevin Lingerfelt 4c019c27c1
Add pod spec annotation to disable injection in CLI and auto-injector (#2187)
* Add pod spec annotation to disable injection in CLI and auto-injector
* Remove support for linkerd.io/auto-inject label entirely
* Update based on review feedback
* Fix issue with finding the namespace of deployments applied to the default ns

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-01 16:57:06 -08:00
Alejandro Pedraza aced50f3cd
Update CHANGES.md for edge-19.1.4 release (#2186)
Update CHANGES.md for edge-19.1.4 release

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-31 17:59:40 -05:00
Cody Vandermyn a283dabbed Added flags to allow further configuration of destination cni bin and cni conf directories; fixed up spacing in template. (#2181)
Signed-off-by: Cody Vandermyn <cody.vandermyn@nordstrom.com>
2019-01-31 13:52:39 -08:00
Alex Leong 3bd4231cec
Add support for timeouts in service profiles (#2149)
Fixes #2042 

Adds a new field to service profile routes called `timeout`.  Any requests to that route which take longer than the given timeout will be aborted and a 504 response will be returned instead.  If the timeout field is not specified, a default timeout of 10 seconds is used.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-01-30 16:48:55 -08:00
Andrew Seigner 5651e02496
Add hint URLs for all checks (#2159)
linkerd/website#105 introduced a FAQ page, providing resolutions for all
`linkerd check` failures.

Update each check to reference its corresponding section in the FAQ.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-30 16:26:57 -08:00
Risha Mars 067a70e0d2
Fail CI on unlinted js code (#2178)
I noticed that #2131 was able to merge even though it contained a missing ;
which should have failed lint checks. I think the problem is that if fix is
enabled, running bin/web build fixes the issue and then the lint checks pass on
the fixed but uncommitted code.

We should avoid autofixing in environments that aren't development to avoid
merging unfixed code to master.
2019-01-30 15:58:48 -08:00
Alejandro Pedraza fe234cade1
Use `ca.NewCA()` for generating certs and keys for the proxy injector (#2163)
Use `ca.NewCA()` for generating certs and keys for the proxy injector

- Remove from CA controller everything that dealt with the
webhook/proxy-injector
- Remove no longer needed proxy-injector volumes for 'trust-anchors' and
'webhook-secrets'
- Remove from the proxy-injector the retrieval of the trust anchor and
secrets
- tls flag during install is no longer needed for auto-inject to work

Fixes #2095 and fixes #2166

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-30 16:04:33 -05:00
Cody Vandermyn 906c3cbfc5 WIP: CNI Plugin (#2071)
* Export RootOptions and BuildFirewallConfiguration so that the cni-plugin can use them.
* Created the cni-plugin based on istio-cni implementation
* Create skeleton files that need to be filled out.
* Create the install scripts and finish up plugin to write iptables
* Added in an integration test around the install_cni.sh and updated the script to handle the case where it isn't the only plugin. Removed the istio kubernetes.go file in favor of pkg/k8s; initial usage of this package; found and fixed the typo in the ClusterRole and ClusterRoleBinding; found the docker-build-cni-plugin script
* Corrected an incorrect name in the docker build file for cni-plugin
* Rename linkerd2-cni to linkerd-cni
* Fixup Dockerfile and clean up code a bit as well as logging statements.
* Update Gopkg.lock after master merge.
* Update test file to remove temporary tag.
* Fixed the command to run during the test while building up the docker run.
* Added attributions to applicable files; in the test file, use a different container for each test scenario and also print the docker logs to stdout when there is an error;
* Add the --no-init-container flag to install and inject. This flag will not output the initContainer and will add an annotation assuming that the cni will be used in this case.
* Update .travis.yml to build the cni-plugin docker image before running the tests.
* Workaround golint warnings.
* Create a new command to install the linkerd-cni plugin.
* Add the --no-init-container option to linkerd inject
* Use the setup ip tables annotation during the proxy auto inject webhook prevent/allow addition of an init container; move cni-plugin tests to the integration-test section of travis
* gate the cni-plugin tests with the -integration-tests flag; remove unnecessary deployment .yaml file.
* Incorporate PR Cleanup suggestions.
* Remove the SetupIPTablesLabel annotation and use config flags and the presence of the init container to determine whether the cni-plugin writes ip tables.
* Fix a logic bug in the cni-plugin code that prevented the iptables from being written; Address PR comments; make tests pass.
* Update go deps shas
* Changed the single file install-cni plugin filename to be .conf vs .conflist; Incorporated latest PR comments around spacing with the new renderer among others.
* Fix an issue with renaming .conf to .conflist when needed.
* Renamed some of the variables to try to make it more clear what is going on.
* Address final PR comments.
* Hide cni flags for the time being.

Signed-off-by: Cody Vandermyn <cody.vandermyn@nordstrom.com>
2019-01-30 11:51:34 -08:00
Alejandro Pedraza 1a853cac63
Don't show the tap icon for requests from sources that are not meshed (#2131)
Gray-out the tap icon for incoming requests that are unmeshed

Fixes #1723

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-01-30 14:03:19 -05:00
Alena Varkockova 2691dda5ce Add possibility to filter by owner and label in ListPods (#2161)
Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
2019-01-28 18:50:29 -08:00
Thomas Rampelberg ea61630f9d
Update client-go to 1.13.1 (#2160)
* Update client-go to 1.13.1

Fixes #2145

* Update Dockerfile-bin with new tag

* Update all the dockerfile tags

* Clean gopkg and do not apply cluster defaults

* Update for klog

* Match existing behavior with klog

* Add klog to gopkg.lock

* Update go-deps shas

* Update klog comment

* Update comment to be a non-sentence
2019-01-28 17:42:14 -08:00
Alex Leong 872e1bb026
Add --proto flag to linkerd profile command to read protobuf files (#2128)
Fixes #1425 

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-01-25 11:15:20 -08:00
Kevin Leimkuhler f3325e7d81
Refactor `install`'s `render` output to be helm compatible (#2098)
# Problem
In order to refactor `install` to allow for a more flexible configuration, we
should start with the format of the YAML that it renders. Using the Helm
YAML format will make it easier add flexible configuration options in the
future. Currently, the rendered template that `install` produces does not
follow this format.

# Solution
Use the internals that Helm itself uses to render an inject template that
follows the same formatting rules. Helm's `template` cmd provides a good
outline of what is needed to make Linkerd's `install` cmd work as if it was
a Chart.

# Validation
There are no new tests, but there may not be anything to test at this stage.
This is a WIP PR towards the ultimate goal of `install` allowing a more
flexible configuration.

However, `install` now uses all the Helm `template` internals and therefore
satisfies the needed properties for Helm Charts.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2019-01-25 10:53:35 -08:00
Risha Mars 65f4fd4f2a
Edit changes.md to match the release notes (#2150)
* Edit changes.md to match the release notes on https://github.com/linkerd/linkerd2/releases

Co-Authored-By: rmars <mars@buoyant.io>
2019-01-25 10:49:39 -08:00
Risha Mars c5ac7401e4
Update CHANGES.md for edge-19.1.3 release (#2148)
* Update CHANGES.md for edge-19.1.3 release
2019-01-24 16:02:52 -08:00
Eliza Weisman 846975a190
Remove proxy bind timeout from CLIs (#2017)
This branch removes the `--proxy-bind-timeout` flag from the 
`linkerd inject` and `linkerd install` CLI commands, and the
`LINKERD2_PROXY_BIND_TIMEOUT` environment variable from their output.
This is in preparation for removing that timeout from the proxy (as
described in #2013). 

I thought it was prudent to remove this from the CLIs before removing it
from the proxy, so we can't create a situation where the CLIs produce
output that results in broken proxy containers.

Fixes #2013

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-01-24 15:34:09 -08:00
Alex Leong d542571b65
GetProfiles should always respond with a (possibly empty) profile immediately (#2146)
When `GetProfiles` is called for a destination that does not have a service profile, the proxy-api service does not return any messages until a service profile is created for that service.  This can be interpreted as hanging, and can make it difficult to calculate response latency metrics.

Change the behavior of the API to always return a service profile message immediately.  If the service does not have a service profile, the default service profile is returned.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-01-24 15:22:14 -08:00
Eliza Weisman 3a5d506004
proxy: update pinned version to 5b507a9
This picks up the following proxy commits:

* eaabc48 Update tower-grpc
* e9561de Update h2 to 0.1.16
* 28fd5e7 Add Route timeouts (linkerd/linkerd2-proxy#165)
* 5637372 Re-flag tcp_duration tests as flaky
* 20cbd18 Revise several log levels and messages (linkerd/linkerd2-proxy##177)
* ae16978 Remove flakiness from 'profiles' tests
* 49c29cd canonicalize: Only log errors at the WARN level when falling back (linkerd/linkerd2-proxy#174)
* 486dd13 Make outbound router honor `l5d-dst-override` header (linkerd/linkerd2-proxy#173)
* 7adc50d Make timeouts for canonicalization DNS queries tuneable (linkerd/linkerd2-proxy#175)
* 3188179 Try reducing CI flakiness by reducing RUST_TEST_THREADS to 1

Some of these changes will probably need changelog entries:

* Improve logging when rejecting malformed HTTP/2 pseudo-headers
  (carllerche/h2#347)
* Improve logging for gRPC errors (tower-rs/tower-grpc#111)
* Add Route timeouts (linkerd/linkerd2-proxy#165)
* Downgrade several of the noisiest log messages to TRACE
  (linkerd/linkerd2-proxy##177)
* Add an environment variable for configuring the DNS canonicalization
  timeout (linkerd/linkerd2-proxy#175)
* Make outbound router honor `l5d-dst-override` header
  (linkerd/linkerd2-proxy#173)

Perhaps all the logging related changes can be grouped into one
changelog entry, though...

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-01-24 14:46:44 -08:00