Commit Graph

2027 Commits

Author SHA1 Message Date
Tarun Pothulapati 2be43a5f9d
Add Jaeger links to the Linkerd dashboard (#4177)
* Add Jaeger reverse proxy
* add jaegerLink to the metrics table
* update MetricsTable tests
* Add optional jaeger link
* rename grafana_proxy to reverse_proxy

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-05-07 16:35:56 -05:00
Tarun Pothulapati 2a95d373c4
make grafana optional in linkerd-web (#4319)
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-05-07 22:14:55 +05:30
Thomas Rampelberg 2d2fd3f199
The api prop is optional and not used with TrafficSplit. (#4343)
Fixes #4334
2020-05-07 09:04:56 -07:00
Oliver Gould 5b7c8f82d4
proxy: v2.95.0 (#4344)
This release modifies Linkerd's internal buffering to avoid idling out
services as a request arrives. This could cause failures for requests
that are sent exactly once per minute, such as Prometheus scrapes.

---

* Set a grpc-status of UNAVAILABLE only on io errors (linkerd/linkerd2-proxy#498)
* inbound: Remove unnecessary buffer (linkerd/linkerd2-proxy#501)
* buffer: Move idle timeouts into the buffer (linkerd/linkerd2-proxy#502)
* make: Support CARGO_TARGET for multi-arch builds (linkerd/linkerd2-proxy#497)
* release: Use arch-specific paths (linkerd/linkerd2-proxy#508)
2020-05-07 08:13:51 -07:00
Alejandro Pedraza a35ad28e14
Use gotestsum in CI unit test workflow (#4342)
Use [gotestsum](https://github.com/gotestyourself/gotestsum) for running
unit tests in CI, so we get a summary result at the end, instead of having to
scroll up to find failures.

Doesn't apply for integration tests, as only failures are shown there,
and they're easily visible.
2020-05-07 08:56:58 -05:00
Alex Leong a703b5b1dc
Hide development flags in release builds (#4310)
Certain install flags are intended to help with Linkerd development and generally are not useful (and are potentially confusing) to users.

We hide these flags in release (edge or stable) builds of the CLI but show them in all other builds.  The list of affected flags is:

* control-plane-version
* proxy-image
* proxy-version
* image-pull-policy
* init-image
* init-image-version

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-05-05 09:33:10 -07:00
Tarun Pothulapati fc7456ce2a
Refactor linkerd-config-addons configmap (#4318)
* rename linkerd-values to linkerd-config-addons

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* refactor linkerd-config-addons to be more saner

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* add comments for the linkerd-config-addons

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* move _addon.tpl to partials

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* remove unnecessary checks in _addons.tpl

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* add _addon.tpl partials to TestRenderHelm

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>

* remove on a copy

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-05-05 14:11:21 +05:30
Zahari Dichev 4e82ba8878
Multicluster checks (#4279)
Multicluster checks

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-05-05 10:19:38 +03:00
Zahari Dichev cd04b94bb9
Probe manager events emission tests (#4312)
Probe manager events emission tests

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-05-05 08:57:05 +03:00
Matei David 6b9aaac9d6
Add Kubeconfig contex namespace to cli commands' options (#4197) (#4291)
When using cli commands that work on namespaced resources in the cluster, the default namespace used by the cli is hardcoded to the default Kubernetes namespace (i.e 'default'). This update will allow cli commands that operate on namespaced resources to automatically infer what the name of the default  namespace is, by taking the relevant default from the currently used Kubeconfig context. In short, this allows the omission of the -n flag in commands such as linkerd metrics, when working with resources that belong to a namespace that is set as default in the currently active context.

Validation was done manually by setting the default namespace of the currently used context, as well as through two integration tests that target the tap and get command respectively.

Signed-off-by: Matei David <matei.david.35@gmail.com>
2020-05-04 16:21:05 -05:00
Naseem 6aa1e76096
Allow config of prometheus alertmanagers, rules and extra args. (#4220)
This allows end user flexibility for options such as log format. Rather than bubbling up such possible config options into helm values, extra arguments provides more flexibility.

Add prometheusAlertmanagers value allows configuring a list of statically targetted alertmanager instances.
Use rule configmaps for prometheus rules. They take a list of {name,subPath,configMap} values and mounts them accordingly. Provided that subpaths end with _rules.yml or _rules.yaml they should be loaded by prometheus as per prometheus.yml's rule_files content.

Signed-off-by: Naseem <naseem@transit.app>
2020-05-04 14:06:10 -05:00
Alejandro Pedraza 2cd48bc488
Go test failure message wrappers to create GH Annotations (#4292)
* Go test failure message wrappers to create GH Annotations

First part of #4176

## Problem

Failures in go tests need to be properly formatted as Github annotations
so that we can fetch them through Github's API for aggregation and
analysis.

## Solution

A wrapper for error messages has been created in `testutil/annotations.go`.
The idea is that instead of throwing test failures like this:

```go
t.Failf("error retrieving data;\nExpected: %#v\nActual: %#v", expected,
actual)
```

We'd throw them like this:
```go
testutil.AnnotationFatalf("error retrieving data", "error retrieving data;\nExpected: %#v\nActual: %#v", expected,
actual)
```

That will continue reporting the error as before (when using `go test`
or another test runner), but as a side-effect it will also send to
stdout something like:

```
::error file=pkg/inject_test.go,line=133::error retrieving data
```
Which becomes a GH annotation, visible in the CI run summary screen.

The fist string art is used to have the GH annotation be a generic error message
that can be aggregated and counted across multiple test runs. If `testutil.Fatalf(str, args...)`
is called instead, the original error message will be used.

Note that that the output will be produced only when the env var
`GH_ANNOTATION` is set (which will when tests are triggered from a
Github Actions workflow).

Besides `testutil/annotation.go` and its accompanying unit test file,
other changes were made in other tests as examples, the plan being that
in a further PR _all_ the tests will use these wrappers.
2020-05-01 16:16:06 -05:00
Alejandro Pedraza fdd7809f13
Increase timeout for Helm cleanup in integration tests (#4317)
* Increase timeout for Helm cleanup in integration tests

Tests were failing sporadically, waiting for the Helm namespace to get
cleaned up. I verified that it is getting cleaned up, but taking more
time sometimes.
2020-05-01 09:48:37 -05:00
Alejandro Pedraza 9e9f3bb1e2
Not use preemptible nodes in cloud and release workflows (#4315)
Temporarily set `preemptible: false` for cloud and release workflows to
see if that's the cause of nodes getting killed.
2020-04-30 18:05:24 -05:00
Eliza Weisman 6f835c006d
update changelog for edge-20.4.5 (#4314)
* update changelog for edge-20.4.5

This edge release includes several new CLI commands for use with
multi-cluster gateways, and adds liveness checks and metrics for
gateways. Additionally, it makes the proxy's gRPC error-handling
behavior more consistent with other implementations, and includes a fix
for a bug in the web UI.

* CLI
  * Added `linkerd cluster setup-remote` command for setting up a
    multi-cluster gateway
  * Added `linkerd cluster gateways` command to display stats for
    multi-cluster gateways
  * Changed `linkerd cluster export-service` to modify a provided YAML
    file and output it, rather than mutating the cluster
* Controller
  * Added liveness checks and Prometheus metrics for multi-cluster
    gateways
  * Changed the proxy injector to configure proxies to do destination
    lookups for IPs in the private IP range
* Web UI
  * Fixed errors when viewing resource detail pages
* Internal 
 * Created script and config to build a Linkerd CLI Chocolatey package
    for Windows users, which will be published with stable releases 
    (thanks to @drholmie!)
* Proxy
  * Changed the proxy to set a `grpc-status: UNAVAILABLE` trailer when a
    gRPC response stream is interrupted by a transport error

Signed-off-by: Eliza Weisman <eliza@buoyant.io>

* review feedback

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-04-30 15:23:13 -07:00
Eliza Weisman 8cf2d63feb
proxy: v2.94.0 (#4313)
This release improves gRPC-aware error handling to set a `grpc-status`
to `UNAVAILABLE` when a response stream is interrupted by a transport
error. This is consistent with common gRPC implementations' error-
handling behavior.

---

* Handle GRPC body errors (linkerd/linkerd2-proxy#493)
2020-04-30 11:41:43 -07:00
Alex Leong 40b921508f
Inject LINKERD2_PROXY_DESTINATION_GET_NETWORKS proxy variable (#4300)
Fixes #3807

By setting the LINKERD2_PROXY_DESTINATION_GET_NETWORKS environment variable, we configure the Linkerd proxy to do destination lookups for authorities which are IP addresses in the private network range.  This allows us to get destination metadata including identity for HTTP requests which target an IP address in the cluster, Prometheus metrics scrape requests, for example.

This change allowed us to update the "direct edges" test which ensures that the edges command produces correct output for traffic which is addressed directly to a pod IP.

We also re-enabled the "linkerd stat" integration tests which had been disabled while the destination service did not yet support these types of IP queries.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-04-30 11:22:24 -07:00
Zahari Dichev 00f17d2ed6
Make export-service non side-effecting (#4307)
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-04-30 17:11:55 +03:00
Thomas Rampelberg 16c97e8e8f
Fix detail page rendering (#4306) 2020-04-29 15:00:10 -07:00
Tarun Pothulapati e75c6580ec
refacor TestRenderHelm to not need addOn list (#4297)
- rather than passing the list of add-ons, they can instead be built from the values

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-04-29 23:44:30 +05:30
Zahari Dichev 5149152ef3
Multicluster gateway and remote setup command (#4265)
Add multicluster gateway and setup command

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-04-29 20:33:23 +03:00
drholmie 7a560a723d
Linkerd CLI Chocolatey Package (#4205)
* Add Linkerd CLI Chocolatey Package

This PR partially fixes #3063 by building a chocolatey package for Linkerd2's Windows CLI
It adds the build scripts for the Linkerd chocolatey package and based on discussions in
https://github.com/linkerd/linkerd2/pull/3921

Signed-off-by: Animesh Narayan Dangwal <animesh.leo@gmail.com>
2020-04-29 09:41:54 -07:00
Alejandro Pedraza 66ec92aa09
Additional Jest reporter for GH Annotations (#4294)
Second part of #4176

Added extra Jest reporter when running js tests from CI, which will send
to stdout a GH annotation for each test failure, something like:

```
::error file=/home/alpeb/src/forks/linkerd2/web/app/js/components/Navigation.test.jsx::Navigation › checks state when versions do not match
```

See the [health
metrics RFC](https://github.com/linkerd/rfc/blob/master/design/0002-ci-health-metrics.md) for more context.
2020-04-28 13:10:27 -05:00
Alejandro Pedraza 437f53cdcf
Fix bin/root-tag when applied to annotated tags (#4299)
Fixes #4298

Since we started using using annotated tags for releases (because they
need to be signed), `bin/root-tag` will append `^0` to them when used
after checking out a release tag. E.g.:

```
$ bin/root-tag
edge-20.4.4^0
```

which breaks version checking by the CLI.

This PR removes that trailing `^0` whenever it's present
2020-04-27 11:08:51 -05:00
Zahari Dichev 17dacf5548
Add gateways command, allowing the retrieval of gateway stats (#4241)
Add gateways command, allowing the retrieval of gateway stats

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-04-27 13:55:01 +03:00
Zahari Dichev 09262ebd72
Add liveliness checks and metrics for multicluster gateway (#4233)
Add liveliness checks for gateway

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-04-27 13:06:58 +03:00
cpretzer 64aff41f93
Release edge-20.4.4
Signed-off-by: Charles Pretzer <charles@buoyant.io>
2020-04-24 17:03:37 -07:00
Thomas Rampelberg f9836c3323
Fix loading for docker build (#4293)
* Fix loading for docker build

* Bump base node image
2020-04-24 13:58:34 -07:00
cpretzer 93f8b96649
Release notes for edge-20.4.3 (#4290)
* Release notes for edge-20.4.3

Signed-off-by: Charles Pretzer <charles@buoyant.io>
2020-04-24 10:40:06 -07:00
Alejandro Pedraza dacf87e084
Added missing annotations to addon test fixtures (#4286)
Followup to #4271

Add missing annotation `linkerd.io/workload-ns: linkerd` in in the
addons test fixtures, introduced by the downward work from #4199
2020-04-23 16:15:16 -05:00
Kevin Leimkuhler c8bca67306
Update integration tests to use kind 0.7.0 (#4282)
I missed these integration test version bumps in #4280 

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-23 13:53:00 -07:00
Tarun Pothulapati 60ffd1c2a2
Support Multi-stage install with Add-On's (#4271)
* Support Multi-stage install with Add-Ons
* add upgrade tests for add-ons
* add multi stage upgrade unit tests

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-04-23 14:40:58 -05:00
Thomas Rampelberg 426d558f43
Fix security issues by bumping all dependencies (#4284)
* Fix security issues by bumping all dependencies.

* Bump node version to latest
2020-04-23 10:31:55 -07:00
Oliver Gould 5ecf2cc57b
proxy: v2.93.0 (#4283)
This release introduces a per-endpoint authority-override feature. This
is driven by the destination controller and is needed to support
mutli-cluster gateways.

---

* Update to Rust 1.42.0 (linkerd/linkerd2-proxy#483)
* Adjust metric description. (linkerd/linkerd2-proxy#484)
* Use authority override from metadata (linkerd/linkerd2-proxy#458)
2020-04-22 13:57:02 -07:00
Kevin Leimkuhler 00b8ea22a0
Update kind version (#4280)
#4195 relaxed the clock skew check to match the Kubernetes 1.17 default
heartbeat interval.

This is the same issue that was preventing an update to the `kind` version
used.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-22 11:38:44 -07:00
Tarun Pothulapati 2b1cbc6fc1
charts: Using downwardAPI to mount labels to the proxy container (#4199)
* use downward API to mount labels to the proxy container as a volume
* add namespace as a label to the pod
* add a trace inject test
* add downwardAPi for controlplaneTracing
* add controlPlaneTracing condition to volumeMounts
* update add-ons to have workload-ns
* add workload-ns label to control-plane components

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-04-22 10:33:51 -05:00
Oliver Gould 1800d3e972
Introduce a security policy (#4281)
When users or researchers discover security issues in Linkerd, they may
prefer to communicate privately, rather than through our public issues.

I've put together a first version of this security policy into
SECURITY.md, which GitHub integrates with:

See https://help.github.com/en/github/managing-security-vulnerabilities/adding-a-security-policy-to-your-repository

Fixes #3009
2020-04-21 16:01:31 -07:00
Alejandro Pedraza b00a84126d
Some `linkerd stat` test failures were being hidden (#4272)
* Some `linkerd stat` test failures were being hidden

`linkerd stat` was doing an early `os.Exit(0)` when no traffic was
found, which avoided `go test` to report any test failure that ended in
that code path.

This was hiding a mismatch in the golden files for HA after the
introduction of the rolling update strategy (#4267), and the failure of
`linkerd stat trafficsplit` not returning results unless `--unmeshed` is
used. For the latter, I added the flag to the tests in order to temporarly pass
them, but the underlying issue remains to be fixed in a separate
PR.
2020-04-21 14:52:09 -05:00
Kevin Leimkuhler 2c38f228f7
Add MeshedPodCount field to TS resource rows (#4273)
The addition of the `--unmeshed` flag changed the rendering behavior of the
`stat` command so that resources with 0 meshed pods are not displayed by
default.

Rendering is based off the row's `MeshedPodCount` field which is currently not
set by `func trafficSplitResourceQuery`. This change sets that field now so
that in rendering, the trafficsplit resource is rendered in the output.

The reason for this not showing up in testing is addressed by #4272 where the
`stat` command behavior for no traffic is changed.

The following now works without `--unmeshed` flag being passed:

```
❯ bin/linkerd stat -A ts
NAMESPACE   NAME                    APEX          LEAF          WEIGHT   SUCCESS   RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99
default     backend-traffic-split   backend-svc   backend-svc     500m         -     -             -             -             -
default     backend-traffic-split   backend-svc   failing-svc        0         -     -             -             -             -
```
2020-04-21 10:23:35 -07:00
Alex Leong 9bf54d36ed
Upgrade to go 1.14.2 (#4278)
Upgrade Linkerd's base docker image to use go 1.14.2 in order to stay modern.

The only code change required was to update a test which was checking the error message of a `crypto/x509.CertificateInvalidError`.  The error message of this error changed between go versions.  We update the test to not check for the specific error string so that this test passes regardless of go version.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-04-20 17:14:51 -07:00
Alex Leong 5d3862c120
Use /live for liveness probe (#4270)
Fixes #3984

We use the new `/live` admin endpoint in the Linkerd proxy for liveness probes instead of the `/metrics` endpoint.  This endpoint returns a much smaller payload.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-04-17 14:53:32 -07:00
Kevin Leimkuhler b13e2442b1
Add rolling update strategy to multi-replica pods (#4267)
This introduces a rolling update strategy to Linkerd deployments that have
three replicas during HA deployments. This allows for at most one pod to begin
terminating before a new pod ready is ready.

This allows for upgrades to take place on three node clusters. As a pod begins
terminating, it opens up the node for the new pod to start initializing.

`.Values.enablePodAntiAffinity` was chosen as the conditional here because it
is set by the `values-ha.yaml` config on HA deployments
2020-04-16 16:49:11 -07:00
Tarun Pothulapati 8e56166774
Refactor AddOn Installation (#4247)
* refactor add-ons install code

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-04-16 15:24:55 -05:00
Alex Leong e962bf1968
Improve proxy version diagnostics (#4244)
It can be difficult to know which versions of the proxy are running in your cluster, especially when you have pods running at multiple different proxy versions.

We add two pieces of CLI functionality to assist with this:

The `linkerd check --proxy` command will now list all data plane pods which are not up-to-date rather than just printing the first one it encounters:

```
‼ data plane is up-to-date
    Some data plane pods are not running the current version:
	* default/books-84958fff5-95j75 (git-ca760bdd)
	* default/authors-57c6dc9b47-djldq (git-ca760bdd)
	* default/traffic-85f58ccb66-vxr49 (git-ca760bdd)
	* default/release-name-smi-metrics-899c68958-5ctpz (git-ca760bdd)
	* default/webapp-6975dc796f-2ngh4 (git-ca760bdd)
	* default/webapp-6975dc796f-z4bc4 (git-ca760bdd)
	* emojivoto/voting-54ffc5787d-wj6cp (git-ca760bdd)
	* emojivoto/vote-bot-7b54d6999b-57srw (git-ca760bdd)
	* emojivoto/emoji-5cb99f85d8-5bhvm (git-ca760bdd)
	* emojivoto/web-7988674b8b-zfvvm (git-ca760bdd)
	* default/webapp-6975dc796f-d2fbc (git-ca760bdd)
	* default/curl (git-7f6bbc73)
    see https://linkerd.io/checks/#l5d-data-plane-version for hints
```

The `linkerd version` command now supports a `--proxy` flag which will list all proxy versions running in the cluster and the number of pods running each version:

```
linkerd version --proxy
Client version: dev-7b9d475f-alex
Server version: edge-20.4.1
Proxy versions:
	edge-20.4.1 (10 pods)
	git-ca760bdd (11 pods)
	git-7f6bbc73 (1 pods)
```

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-04-16 11:28:19 -07:00
Zahari Dichev ecd44d85fa
Changes for edge-20.4.2 (#4263)
*## edge-20.4.2

This release brings a number of CLI fixes and Controller improvements.

* CLI
  * Fixed a bug that caused the proxy to crash after upgrade if
    `--skip-outbound-ports` or `--skip-inbound-ports` were used
  * Added `unmeshed` flag to the `stat` command, such that unmeshed resources
    are only displayed if the user opts-in
  * Added a `--smi-metrics` flag to `install`, to allow installation of the
    experimental `linkerd-smi-metrics` component
  * Fixed a bug in `linkerd stat`, causing incorrect output formatting when using
    the `wide` flag
  * Fixed a bug, causing `linkerd uninstall` to fail when attempting to delete
    PSPs
* Controller
  * Improved the anti-affinity of `linkerd-smi-metrics` deployment to avoid
    pod scheduling problems during `upgrade`
  * Improved endpoints change detection in the `destinations` service, enabling
    mirrored remote services to change cluster gateways     

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-04-16 19:57:42 +03:00
Oliver Gould b3587633a0
proxy: v2.92.0 (#4264)
This release includes a new protocol detection timeout, which prevents
clients from consuming resources indefinitely when they do not send any
data.

Additionally: the proxy's admin endpoint now supports a `/live` endpoint
for liveness checks, and a feature has been added to enrich tracing
metadata from a file of label/values.

---

* Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463)
* Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470)
* docker: Use buildkit for caching (linkerd/linkerd2-proxy#472)
* Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475)
* Add checksec to the release process (linkerd/linkerd2-proxy#476)
* Time out protocol detect futures (linkerd/linkerd2-proxy#464)
* Ensure that checksec is executable (linkerd/linkerd2-proxy#477)
* Fix the checksec URL (linkerd/linkerd2-proxy#478)
* Undo hardcoded release version (linkerd/linkerd2-proxy#479)
2020-04-15 17:19:26 -07:00
Kevin Leimkuhler b6aad75b35
Add `operationID` field to tap openapi response (#4245)
This fixes an issue users are experiencing when upgrading from from Linkerd
2.6 to 2.7 and use the [kubernetes-external-secrets]() project.

The change introduced by #3700 resulted in the tap service showing up in the
`/openapi/v2` API response. I confirmed this with a local build.

A dependency within the project expects the `operationID` field to be present
in the swagger definition. It is optional as stated in the
[spec](https://swagger.io/docs/specification/paths-and-operations/). It's
purpose is to identify an operation and should be unique.

This change adds that field to tap service swagger spec. While this can be
fixed in the KES dependency, it certainly does not hurt to add and other
libraries may similarly expect this field.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-15 09:41:06 -07:00
Kevin Leimkuhler 3e5b5ae299
Fix component label value for smi-metrics anti-affinity (#4260)
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-15 17:35:42 +03:00
Alejandro Pedraza 7d07504b5b
Upgrade crashes proxy-init when skipping ports (#4258)
Fixes #4257

This was introduced in 2.7.0. When performing an upgrade on an
installation having used `--skip-outbound-ports` or
`--skip-inbound-ports`, the upgrade picks those values from the
ConfigMap, parses them wrongly, and then when proxy-init picks them the
iptables commands fail.

I've also improved one of the upgrade unit tests to include these flags,
and confirmed it failed before this fix.
2020-04-15 07:11:15 -05:00
Kevin Leimkuhler 0d235694af
Add `unmeshed` flag to stat command (#4254)
## Motivation

Introduces an `unmeshed` flag to the `stat` command so that users can opt-in
to viewing unmeshed resources in the `stat` output.

This changes the existing behavior of the `stat` command such that unmeshed
resources no longer render by default in the output.

Before:

```
❯ bin/linkerd stat -A deploy
NAMESPACE     NAME                     MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TCP_CONN
kube-system   coredns                     0/1         -        -             -             -             -          -
kube-system   local-path-provisioner      0/1         -        -             -             -             -          -
kube-system   metrics-server              0/1         -        -             -             -             -          -
kube-system   traefik                     0/1         -        -             -             -             -          -
linkerd       linkerd-controller          1/1   100.00%   0.3rps           1ms           2ms           2ms          2
linkerd       linkerd-destination         1/1   100.00%   0.3rps           1ms           1ms           1ms         11
...
```

After:

```
❯ bin/linkerd stat -A deploy
NAMESPACE   NAME                     MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TCP_CONN
linkerd     linkerd-controller          1/1   100.00%   0.3rps           1ms           1ms           1ms          2
linkerd     linkerd-destination         1/1   100.00%   0.3rps           1ms           2ms           2ms         13
...
```

Closes #3871

## Solution

Using the meshed pod count in the stat response, resources with a count of `0`
are not rendered in the table.

The `-l`/`--selector` flag do not work for all resource types, so applying a
default label does not solve this problem. While it works for pods, it does
not work for deployments as the `linkerd.io/inject` is an annotation that
cannot be selected on.

I did not think a shorthand flag was necessary for this. I do not think users
will commonly pass this flag to the `stat` command, and I didn't think adding
an additional short flag such as `u` was necessary.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-04-14 20:24:29 -07:00