Commit Graph

2180 Commits

Author SHA1 Message Date
Alex Leong d9edec1022
Clean up .dockerignore and .gitignore (#4656)
Make some minor tweaks to `.gitignore` and `.dockerignore` to make them more similar.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-06-23 16:39:17 -07:00
Oliver Gould ca1a9f66d2
go-run: Move temporary binary into `target` directory (#4657)
The `bin/go-run` script generates a temporary binary, stored in the root
of the repository.

This change moves it into `target/` so that is included in the
.dockerignore, and so that the repo can be cleaned easily by removing
the `target/` directory.
2020-06-23 15:55:34 -07:00
Oliver Gould d43ec41574
Relax review requirements on cni-plugin/Dockerfile (#4655)
The /cni-plugin directory has additional review requirements; however,
its Dockerfile changes each time `go.mod` is updated. It was not
intended to require this extra review on these routine changes.

This change updates CODEOWNERS to make all maintainers owners of
`cni-plugin/Dockerfile`.
2020-06-23 15:23:38 -07:00
Ivan Sim 7927be6856
Update GitHub issue templates (#4654)
Link the 'Question' option to the 'Discussion' page

Signed-off-by: Ivan Sim <ivan@buoyant.io>
2020-06-23 13:43:53 -07:00
Alejandro Pedraza 83ae0ccf0f
Release notes for stable-2.8.1 (#4652)
* Release notes for stable-2.8.1

This release fixes multicluster gateways support on EKS.

* The multicluster service-mirror has been extended to resolve DNS names for
  target clusters when an IP address is not known.
* Linkerd checks could fail when run from the dashboard. Thanks to @alex-berger
  for providing a fix!
* Have the service mirror controller check in `linkerd check` retry on failures.
* As of this version we're including a Chocolatey package (Windows) next to the
  other binaries in the release assets in GitHub.
* Base images have been updated:
  * debian:buster-20200514-slim
  * grafana/grafana:7.0.3
* The shell scripts under `bin` continued to be improved, thanks to @joakimr-axis!
2020-06-23 12:12:06 -05:00
Mayank Shah 7f29717a64
Refactor helper functions from `inject` integration tests (#4644)
move `applyPatch` `useTestImageTag`, `validateInject``getProxyContainers` as global functions to be used!
2020-06-22 23:15:52 +05:30
Zahari Dichev 7c98e89bdc
Make `service mirror controller is running check` retry (#4650)
This PR makes the service mirror controller is running retry on failure. This brings the check in line with the rest of the checks that verify that certain Linkerd components are running. It is especially useful in integration tests when we want to wait for the service mirror component to be initialized for a certain amount of time before we simply fail the linkerd check command

Fix #4642

Signed-off-by: Zahari Dichev zaharidichev@gmail.com
2020-06-22 20:33:43 +03:00
Alejandro Pedraza 27b2838c52
Post-2.8.0 integration test cleanup (#4641)
* Post-2.8.0 integration test cleanup

We had some code for testing upgrades from pre-2.8.0 stables that took
care of creating the non-existent `linkerd-smi-metrics` SA, which is no
longer necessary.

I also had missed many spots in test/install_test.go from #4623
2020-06-22 09:09:04 -05:00
Joakim Roubert 8d19b4055b
Improve shellscript portability by using /bin/env (#4628)
Using `/bin/env` increases portability for the shell scripts (and often using `/bin/env` is requested by e.g. Mac users). This would also facilitate testing scripts with different Bash versions via the Bash containers, as they have bash in `/usr/local` and not `/bin`. Using `/bin/env`, there is no need to change the script when testing. (I assume the latter was behind c301ea214b (diff-ecec5e3a811f60bc2739019004fa35b0), which would not happen using `/bin/env`.)

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2020-06-19 15:49:29 -04:00
cpretzer 84a29b9612
Prevent kind-load from resolving TAG when images are provided (#4634)
* Update the logic for resolving the tag based on script parameters
Signed-off-by: Charles Pretzer <charles@buoyant.io>
2020-06-19 11:29:50 -07:00
Joakim Roubert 82e91382b7
test-cleanup: Make populate_array() bash 3-friendly (#4627)
Fixes #4621

Legacy versions of bash (used in e.g. Mac OS) do not have the [nameref](https://www.gnu.org/software/bash/manual/html_node/Shell-Parameters.html) functionality.
This patch replaces the use of that in the `populate_array` function and uses a bash 3-friendly way of handing this instead.

([Kubernetes](https://github.com/kubernetes/kubernetes) developers will recognize this bash 3-friendly way from [kube::util::read-array](d8febccacf/hack/lib/util.sh (L755-L770)) in the Kubernetes code base.)

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-06-18 17:35:34 -04:00
Alejandro Pedraza ba420f2fac
Fix release workflow - avoid downloading choco package in edges (#4638)
Added guard against trying to download choco package when not doing a
stable release.
2020-06-18 16:02:53 -05:00
Alejandro Pedraza d02359e094
Int tests: Warn (instead of erroring) upon pod restarts, part two (#4637)
In #4595 we stopped failing integration tests whenever a pod restarted
just once, which is being caused by containerd/containerd#4068.

But we forgot to remove the warning event corresponding to that
containerd failure, and such unexpected event continues to fail the
tests. So this change adds that event to the list of expected ones.
2020-06-18 15:50:51 -05:00
Alejandro Pedraza 2696ea94dd
Fix release workflow dependencies on choco_pack (#4635)
The `choco_pack` job only runs for stable tags. In order for jobs to
depend on it to run on non-stable tags, we need to move this tag check from the
`choco_pack` job level down into its steps.
2020-06-18 13:50:19 -05:00
Zahari Dichev fe373414aa
Changes for edge-20.6.3 (#4629)
## edge-20.6.3

This edge release is a release candidate for stable-2.8.1. It includes a fix
to support multicluster gateways on EKS.

* The `config.linkerd.io/proxy-destination-get-networks` annotation configures
  the networks for which a proxy can discover metadata. This is an advanced
  configuration option that has security implications.
* The multicluster service-mirror has been extended to resolve DNS names for
  target clusters when an IP address it not known.
* Linkerd checks could fail when run from the dashboard. Thanks to @alex-berger
  for providing a fix!
* The CLI will be published for Chocolatey (Windows) on future stable releases.
* Base images have been updated:
  * debian:buster-20200514-slim
  * grafana/grafana:7.0.3

Signed-off-by: Zahari Dichev zaharidichev@gmail.com
Co-authored-by: Oliver Gould <ver@buoyant.io>
2020-06-18 20:32:08 +03:00
Zahari Dichev 7f3d872930
Add destination-get-networks option (#4608)
In #4585 we are observing an issue where a loop is encountered when using nginx ingress. The problem is that the outbound proxy does a dst lookup on the IP address which happens to be the very same address the ingress is listening on.

In order to avoid situations like that this PR introduces a way to modify the set of networks for which the proxy shall do IP based discovery. The change introduces a helm flag `.Values.global.proxy.destinationGetNetworks` that can be used to modify this value. There are two ways a user can affect the this setting: 


- setting the `destinationGetNetworks` field in values during a Helm install, which changes the default on all injected pods
- using an annotation ` config.linkerd.io/proxy-destination-get-networks` for injected workloads to override this value

Note that this setting cannot be tweaked through the `install` or `inject` command

Fix: #4585

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-06-18 20:07:47 +03:00
Alejandro Pedraza 0404703b9e
Fix `bin/update-go-deps-shas` in Ubuntu (#4632)
Explicitly shebang `bin/update-go-deps-shas` with `#!/bin/bash` instead
of `#!/bin/sh` because the latter points to `dash` in most Ubuntu-based
distros, and the script's `bin/_tag.sh` dependency requires bash.
2020-06-18 12:03:04 -05:00
Kevin Leimkuhler d5591f07ac
Fix helm upgrade test (#4622)
## Problem

#4557 changed the name of the function that `helm_upgrade_integration_tests`
uses.

`install_stable()` was renamed to `latest_release_channel()` and now takes an
argument for specifying either `edge` or `stable`.

`run_helm_upgrade_test` is a function used by the helm upgrade integration test
and was not properly updated to use `latest_release_channel()`.

This silently passed integration tests because `run_helm_upgrade_test` started
passing an empty string for the version to upgrade from, which results in the
default behavior of `install_test.go`--and therefore still passes.

## Solution

`run_helm_upgrade_test` now uses `latest_release_channel()` and passes the
proper argument.

Additionally, it checks that the version returned from
`latest_release_channel()` is not empty. If it is empty, it exits the test. This
ensures something like this does happen in the future.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-06-18 12:22:15 -04:00
Mayank Shah 90041371d1
Update function signature of `testutil.NewGenericTestHelper` (#4591)
Adds parameters like kubernetesHelper, k8scontext, etc to the NewGenericTestHelper func allowing it to be more general, and to be able to be usable through linkerd2-conformance
2020-06-18 16:53:27 +05:30
Alejandro Pedraza c8c5980d63
Integration tests: Warn (instead of erroring) upon pod restarts (#4623)
* Integration tests: Warn (instead of erroring) upon pod restarts

Fixes #4595

Don't have integration tests fail whenever a pod is detected to have
restarted just once. For now we'll be just logging this out and creating
a warning annotation for it.
2020-06-18 06:08:05 -05:00
cpretzer b176fbeb6d
Upgrade Grafana to 7.0.3 (#4600)
* Upgrade Grafana to 7.0.3
* use go netdns to avoid DNS resolution errors on alpine

Signed-off-by: Charles Pretzer <charles@buoyant.io>
2020-06-17 21:35:29 -07:00
Kevin Leimkuhler f6bd722e2c
Fix install-pr script (#4610)
* Fix install-pr script
* Add image-archives path to commands to use the files

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
Signed-off-by: Charles Pretzer <charles@buoyant.io>
Co-authored-by: Charles Pretzer <charles@buoyant.io>
2020-06-17 21:32:01 -07:00
Kevin Leimkuhler fe71ef04b0
Remove `--prune` from multi-stage upgrade docs (#4613)
Fixes #4606

This has not worked as far back as stable-2.6.0.

## Solution

The recommended upgrade process is to include `--prune` as part of `kubectl
apply ..`:

```bash
$ linkerd upgrade | kubectl apply --prune -l linkerd.io/control-plane-ns=linkerd -f -
```

This is an issue for multi-stage upgrade because `linkerd upgrade config` does
not include the `linkerd-config` ConfigMap in it's output.

`kubectl apply --prune ..` will then prune this resource because it matches the
label selector *and* is not in the above output.

The issue occurs when `linkerd upgrade control-plane` is run and expects to find
the ConfigMap that was just pruned.

This can be fixed by not suggesting to prune resources as part of the
multi-stage upgrade.

## Considered

Including `templates/config.yaml` in the install output regardless of the stage.
Instead of it being a template only used in `control-plane` stage in
[render](4aa3ca7f87/cli/cmd/install.go (L873-L886)), it could always be rendered.

This just exposes other things that are pruned in the process:

```bash
❯ bin/linkerd upgrade control-plane |kubectl apply --prune -l linkerd.io/control-plane-ns=linkerd -f -
× Failed to build upgrade configuration: secrets "linkerd-identity-issuer" not found
For troubleshooting help, visit: https://linkerd.io/upgrade/#troubleshooting

error: no objects passed to apply
```

Ultimately, resources part of the `control-plane` stage need to remain and that
will not happen if we prune all resources not in the `config` stage output

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
2020-06-17 10:29:34 -04:00
Oliver Gould bb01b94e8a
Pin bb protobuf to a stable sha (#4619)
The bb repo does not have a master branch anymore. We should just pin
the SHA to avoid branches and changes all together.
2020-06-16 18:16:55 -07:00
Kevin Leimkuhler b0765c4361
Add integration test for upgrading from edge (#4557)
This adds an integration test for upgrading from the latest edge to the current
build.

Closes #4471

Signed-off-by: Kevin Leimkuhler kevin@kleimkuhler.com
2020-06-16 09:18:52 -07:00
Alejandro Pedraza d10ed2aa5e
CI steps for Chocolatey package - take 2 (#4536)
* CI steps for Chocolatey package - take 2

Followup to #4205, supersedes #4205

This adds:

- A new job psscript-analyzer into the `statics_checks.yml`
workflow for linting the Chocolatey Powershell script.
- A new `choco_pack` job in the `release.yml` workflow for
updating the Chocolatey spec file and generating the
package. This is only triggered for stable releases. It requires
a windows runner in order to run the choco tooling (in theory
it should have worked on a linux runner but in practice it
didn't).
- The `Create release` step was updated to upload the generated package,
if present.
- The source file path in `bin/win/linkerd.nuspec` was updated
to make this work.

* Name nupkg file accordingly to the other release assets
2020-06-15 16:42:50 -05:00
Oliver Gould 959fe78596
Simplify CODEOWNERS constraints (#4594)
My experience of our CODEOWNERS setup is that it frequently causes us to
require additional pro-forma reviews, but I think we can do a decent job
of getting the proper reviews informally without enforcing ownership.

I'd like to simplify this by relaxing the CODEOWNERS to add
@linkerd/maintainers by default. The project infrastructure docs should
remain locked-down, requiring a review from me; and I've updated the
CHANGES review requirement to be @adleong and I (practically, I'll
review most of the CHANGES, but Alex is a suitable fallback in most
cases).

Then, we leave the CNI ownership as-is (unless others want to volunteer
for those reviews ;).
2020-06-15 14:31:29 -07:00
Joakim Roubert 57f321b14b
Use buster for base and web images too (#4567)
Requires setting iptables-legacy as the iptables provider.

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-06-15 10:49:26 -07:00
Alex Leong 755538b84a
Resolve gateway hostnames into IP addresses (#4588)
Fixes #4582 

When a target cluster gateway is exposed as a hostname rather than with a fixed IP address, the service mirror controller fails to create mirror services and gateway mirrors for that gateway.  This is because we only look at the IP field of the gateway service.

We make two changes to address this problem:
 
First, when extracting the gateway spec from a gateway that has a hostname instead of an IP address, we do a DNS lookup to resolve that hostname into an IP address to use in the mirror service endpoints and gateway mirror endpoints.

Second, we schedule a repair job on a regular (1 minute) to update these endpoint objects.  This has the effect of re-resolving the DNS names every minute to pick up any changes in DNS resolution.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-06-15 10:33:49 -07:00
Alexander Berger b509742c7d
Fix ClusterRole for web-check (#4599)
As reported in #4259 linkerd check run from linkerd's web cconsole is
broken as the underlying RBAC Role cannot access the apiregistration.k8s.io API Group.

With this commit the RBAC Role is fixed allowing read-only access to the API Group
apiregistration.k8s.io.

Fixes #4259

Signed-off-by: alex.berger@nexiot.ch <alex.berger@nexiot.ch>
2020-06-15 10:21:00 -07:00
Joakim Roubert 99a9f1c2c2
Fix missing proxy-init v1.3.2 -> v1.3.3 (#4596)
Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
2020-06-15 10:53:01 -05:00
Mayank Shah 6174b194fe
conformance validation: add new helper to `testutil` (#4532)
Adds a new helper function to make TestHelper initialization more relaxed for linkerd2-conformance and other test use-cases.
2020-06-12 10:45:42 +05:30
Alejandro Pedraza 7a9527bf00
Fix yaml in linkerd-config-addons when providing grafanaUrl (#4581)
Put back space after `grafanaUrl` label in `linkerd-config-addons.yaml`
to avoid breaking the yaml parsing.

```
$ linkerd check
...
linkerd-addons
--------------
‼ 'linkerd-config-addons' config map exists
    could not unmarshal linkerd-config-addons config-map: error
    unmarshaling JSON: while decoding JSON: json: cannot unmarshal
    string into Go struct field Values.global of type linkerd2.Global
```
This was added in #4544 to avoid having the configmap being badly formatted.

So this PR fixes the yaml, but then if we don't set `grafanaUrl` the
configmap format gets messed up, but apparently that's just a cosmetic
problem:

```
apiVersion: v1
data:
  values: "global:\n  grafanaUrl: \ngrafana:\n  enabled: true\n
  image:\n    name:
      gcr.io/linkerd-io/grafana\n  name: linkerd-grafana\n  resources:\n
      cpu:\n      limit:
          240m\n    memory:\n      limit: null\ntracing:\n  enabled:
          false"
          kind: ConfigMap
```
2020-06-09 11:08:32 -07:00
Oliver Gould 37f3b10d28
stable-2.8.0: Add note regarding #4582 (#4583)
Add a note warning users that `multicluster` does not yet work with on
Amazon EKS (#4582).
2020-06-09 10:57:43 -07:00
Oliver Gould 3d77f06f1a
Add release notes for stable-2.8.0 (#4577) 2020-06-09 09:23:44 -07:00
Tarun Pothulapati ba40a950bc
update chart readme to remove grafana.image.version (#4579) 2020-06-09 21:19:48 +05:30
dependabot[bot] 8fa59bc4f1
Bump websocket-extensions from 0.1.3 to 0.1.4 in /web/app (#4565)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-08 17:08:40 -07:00
Tarun Pothulapati 4219955bdb
multicluster: checks for misconfigured mirror services (#4552)
Fixes #4541 

This PR adds the following checks
-  if a mirrored service has endpoints. (This includes gateway mirrors too).
-  if an exported service is referencing a gateway that does not exist.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Alex Leong <alex@buoyant.io>

Co-authored-by: Alex Leong <alex@buoyant.io>
2020-06-08 15:29:34 -07:00
Tarun Pothulapati 4aa3ca7f87
remove grafana.image.version field (#4571)
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2020-06-08 17:15:30 -05:00
cpretzer ebb9cfe492
adding tmp volume for restrictive pod secuity policies (#4566)
Signed-off-by: Charles Pretzer <charles@buoyant.io>
2020-06-08 13:58:47 -07:00
Alejandro Pedraza b5eec3f05b
Edge-20.6.2 release notes (#4564) 2020-06-05 15:36:44 -05:00
cpretzer b36544980d
Run linkerd-gateway as non-root (#4543)
Container-optimized OS on GKE runs with a set of read/write rules that prevent the linkerd-gateway from starting up.

These changes move the directories that nginx needs to write to /tmp and configures the error_log to write to stderr

Signed-off-by: Charles Pretzer charles@buoyant.io
2020-06-05 13:14:36 -07:00
Zahari Dichev f01bcfe722
Tweak service-mirror log levels (#4562)
This PR just modifies the log levels on the probe and cluster watchers
to emit in INFO what they would emit in DEBUG. I think it makes sense
as we need that information to track problems. The only difference is
that when probing gateways we only log if the probe attempt was
unsuccessful.

Fix #4546
2020-06-05 13:12:36 -07:00
Zahari Dichev 3365455e45
Fix mc labels (#4560)
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-06-05 19:36:09 +03:00
Zahari Dichev b6b95455aa
Fix load balancer missing ip race condition (#4554)
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2020-06-05 19:35:47 +03:00
Alex Leong cffa07ddba
Update gateway identity on gateway mirror endpoints (#4559)
When the identity annotation on a gateway service is updated, this change is not propagated to the mirror gateway endpoints object.

This is because the annotations are updated on the wrong object and the changes are lost.

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-06-05 09:21:35 -07:00
Matei David 654839e639
Add namespace global flag to hold default namespace name (#4469) (#4512)
* Add namespace global flag to hold default namespace name (#4469)

Signed-off-by: Matei David <matei.david.35@gmail.com>

* Change name of controlplane install namespace constant and init point for kubeNamespace

Signed-off-by: Matei David <matei.david.35@gmail.com>
2020-06-04 10:45:07 -07:00
Lutz Behnke 108b383ab8
add flag for dumping rejected results to folder for use with external diff (#4509)
Problem
When updating / writing tests with complex data, e.g the certificates, the build-in diff is not as powerful as dedicated external tool.

Solution
Dump all resource specifications created as part of failing tests to a supplied folder for external analysis.

Signed-off-by: Lutz Behnke <lutz.behnke@finleap.com>
2020-06-04 10:49:41 -04:00
Alex Leong 0f84ff61db
Update gateway mirror ports (#4551)
* Update gateway mirror spec when remote gateway changes

Signed-off-by: Alex Leong <alex@buoyant.io>

* Only update ports

Signed-off-by: Alex Leong <alex@buoyant.io>
2020-06-04 17:25:46 +03:00
Alejandro Pedraza c0afb443d2
Fix mechanism to fetch logs/events upon test failures (#4538)
Followup to #4522

This removes the `controlPlaneInstalled` var in `bin/install_test.go`
that flagged whether the control plane was already present in the series
of tests, whose intention was to avoid fetching the logs/events when the CP wasn't yet
there. That was done under the assumption `TestMain()` would feed that
flag to the runner for each individual test function, but it turns out
`TestMain()` only runs once per test file, and so
`controlPlaneInstalled` remained with its initial value `false`.

So now logs/events are fetched always, even if the control plane is not
there. If the CP is absent and we try fetching, we only see a `didn't
find any client-go entries` message.
2020-06-04 09:11:30 -05:00