Commit Graph

69 Commits

Author SHA1 Message Date
Alejandro Pedraza 1653f88651
Put the destination controller into its own deployment (#3407)
* Put the destination controller into its own deployment

Fixes #3268

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-09-18 13:41:06 -05:00
Andrew Seigner a5a6e8ff9f
Fix integration test event regex matching (#3416)
The integration tests check for known k8s events using a regex. This
regex included an incorrect pattern that prepended a failure reason and
object, rather than simply the event message we were trying to match on.
This resulted in failures such as:
https://github.com/linkerd/linkerd2/runs/217872818#step:6:476

Fix the regex to only check for the event message. Also explicitly
differentiate reason, object, and message in the log output.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-09-10 13:24:22 -07:00
Andrew Seigner 9bb7b6f119
Make KillPodSandbox regex match broader (#3409)
We're getting flakey `KillPodSandbox` events in the integration tests:
https://github.com/linkerd/linkerd2/runs/216505657#step:6:427
This is despite adding a regex for these events in #3380.

Modify the KillPodSandbox event regex to match on a broader set of
strings.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-09-09 11:54:14 -07:00
Bruno M. Custódio 8fec756395 Add '--address' flag to 'linkerd dashboard'. (#3274)
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
2019-09-05 10:56:10 -07:00
Andrew Seigner e51af8c8a9
Add known KillPod k8s event to integration test (#3380)
FailedKillPod events were causing integration tests to fail:
https://github.com/linkerd/linkerd2/runs/212313175#step:6:409

Add FailedKillPod as a known event. Example:
https://play.golang.org/p/WV52tyZgijW

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-09-04 14:00:16 -07:00
Andrew Seigner a8481b721a
GitHub Actions, kind, integration test logs fixes (#3372)
PR #3339 introduced a GitHub Actions CI workflow. Booting 6 clusters
simultaneously (3x Github Actions + 3x Travis) exhibits some transient
failures.

Implement fixes in GitHub Actions and integration tests to address kind
cluster creation and testing:
- Retry kind cluster creation once.
- Retry log reading from integration k8s clusters once.
- Add kind cluster creation debug logging.
- Add a GitHub Actions status badge to top of `README.md`.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-09-04 12:44:27 -07:00
Andrew Seigner 956d1bff06
Update warning event regex for integration test (#3336)
Kubernetes was generating events for failed readiness probes that did
not quite match the expected events regex in the install integration
test:
https://travis-ci.org/linkerd/linkerd2/jobs/577642724#L647

Update the readiness probe regex to handle these variations in events:
https://play.golang.org/p/OVGJkFNN-XA

Relates to CI failure in #3333.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-08-28 10:19:40 -07:00
Andrew Seigner 419e9052ff
Fix flakey upgrade integration test (#3329)
The `linkerd upgrade` integration test compares the output from two
commands:
- `linkerd upgrade control-plane`
- `linkerd upgrade control-plane --from-manifests`

The output of these commands include the heartbeat cronjob schedule,
which is generated based on the current time.

Modify the upgrade integration test to retry the manifest comparison one
time, assuming that `linkerd upgrade control-plane` should not take more
than one minute to execute.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-08-28 09:41:09 -07:00
Alejandro Pedraza 9ee98d35be
Stop ignoring client-go log entries (#3315)
* Stop ignoring client-go log entries

Pipe klog output into logrus. Not doing this avoids us from seeing
client-go log entries, for some reason I don't understand.

To enable, `--controller-log-level` must be `debug`.

This was discovered while trying to debug sending events for #3253.

I added an integration test that fails when this piping is not in place.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-08-26 15:46:31 -05:00
Alejandro Pedraza 4e65ed1e6a Update integration test with new Helm values struct (#3246)
Followup to #3229

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-08-13 19:00:55 -07:00
Alejandro Pedraza d64a2f3689
Add integration test for `helm install` (#3223)
Ref #3143

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-08-13 09:14:32 -05:00
Andrew Seigner a59c1dd32d
Introduce tap APIService, update `linkerd tap` (#3167)
The Tap Service enabled tapping of any meshed pod, regardless of user
privilege.

This change introduces a new Tap APIService. Kubernetes provides
authentication and authorization of Tap requests, and then forwards
requests to a new Tap APIServer, which implements a Kubernetes
aggregated APIServer. The Tap APIServer authenticates the client TLS
from Kubernetes, and authorizes the user via a SubjectAccessReview.

This change also modifies the `linkerd tap` command to make requests
against the new APIService.

The Tap APIService implements these Kubernetes-style endpoints:
POST /apis/tap.linkerd.io/v1alpha1/watch/namespaces/:ns/tap
POST /apis/tap.linkerd.io/v1alpha1/watch/namespaces/:ns/:res/:name/tap
GET  /apis
GET  /apis/tap.linkerd.io
GET  /apis/tap.linkerd.io/v1alpha1
GET  /healthz
GET  /healthz/log
GET  /healthz/ping
GET  /metrics
GET  /openapi/v2
GET  /version

Users authorize to the new `tap.linkerd.io/v1alpha1` via RBAC. Only the
`watch` verb is supported. Access is also available via subresources
such as `deployments/tap` and `pods/tap`.

This change introduces the following resources into the default Linkerd
install:
- Global
  - APIService/v1alpha1.tap.linkerd.io
  - ClusterRoleBinding/linkerd-linkerd-tap-auth-delegator
- `linkerd` namespace:
  - Secret/linkerd-tap-tls
- `kube-system` namespace:
  - RoleBinding/linkerd-linkerd-tap-auth-reader

Tasks not covered by this PR:
- `linkerd top`
- `linkerd dashboard`
- `linkerd profile --tap`
- removal of the unauthenticated tap controller

Fixes #2725, #3162, #3172

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-08-01 14:02:45 -07:00
Ivan Sim 36681218ba
Revert "Increase the retry duration in the post-upgrade 'check' integration test (#2944)" (#3091)
This reverts commit 60c58c1f85.

Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-07-18 09:25:27 -07:00
Ivan Sim 60c58c1f85
Increase the retry duration in the post-upgrade 'check' integration test (#2944)
Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-06-14 12:23:18 -07:00
Alejandro Pedraza 7fc6c195ad
Set MWC and VWC failure policy to 'fail' in HA mode only (#2943)
Fixes #2927

Also moved `TestInstallSP` after `TestCheckPostInstall` so we're sure
the validating webhook is ready before installing a service profile.

Signed-off-by: Alejandro Pedraza Borrero <alejandro@buoyant.io>
2019-06-14 11:50:59 -05:00
Alejandro Pedraza 74ca92ea25
Split proxy-init into separate repo (#2824)
Split proxy-init into separate repo

Fixes #2563

The new repo is https://github.com/linkerd/linkerd2-proxy-init, and I
tagged the latest there `v1.0.0`.

Here, I've removed the `/proxy-init` dir and pinned the injected
proxy-init version to `v1.0.0` in the injector code and tests.

`/cni-plugin` depends on proxy-init, so I updated the import paths
there, and could verify CNI is still working (there is some flakiness
but unrelated to this PR).

For consistency, I added a `--init-image-version` flag to `linkerd
inject` along with its corresponding override config annotation.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-06-03 16:24:05 -05:00
Alejandro Pedraza b384995397
Known warnings should hold just the message part, not the reason nor the involved object name (#2865)
Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-05-29 17:13:31 -05:00
Dennis Adjei-Baah b9cc66c6c8
fixes roleRef name in linkerd-tap rbac (#2845)
* fixes roleRef name in linkerd-tap rbac
2019-05-28 10:05:01 -07:00
Andrew Seigner bd4c2788fa Modify upgrade integration test to upgrade stable (#2835)
In #2679 we introduced an upgrade integration test. At the time we only
supported upgrading from a recent edge. Since that PR, a stable build
was released supporting upgrade.

Modify the upgrade integration test to upgrade from the latest stable
rather than latest edge. This fulfills the original intent of #2669.

Also add some known k8s event warnings.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-05-20 13:36:07 -07:00
Dennis Adjei-Baah a0fa1dff59
Move tap service into its own pod. (#2773)
* Split tap into its own pod in the control plane

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2019-05-15 16:28:44 -05:00
Alejandro Pedraza f4ab9d6f9e
Integration test for k8s events generated during install (#2805)
Integration test for k8s events generated during install

Fixes #2713

I did make sure a scenario like the one described in #2964 is caught.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-05-10 09:09:54 -05:00
Alejandro Pedraza 2ae0daca9f
Add `linkerd inject --manual` test into install_test.go (#2791)
Add `linkerd inject --manual` test into install_test.go

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-05-08 11:13:30 -05:00
Andrew Seigner 66494591e0
Multi-stage check support (#2765)
Add support for `linkerd check config`. Validates the existence of the
Linkerd Namespace, ClusterRoles, ClusterRoleBindings, ServiceAccounts,
and CustomResourceDefitions.

Part of #2337

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-30 17:17:59 +01:00
Andrew Seigner 85a7c885d4
Add known proxy-injector log warning to tests (#2760)
PR #2737 introduced a warning in the proxy-injector when owner ref
lookups failed due to not having up-to-date ReplicaSet information. That
warning may occur during integration tests, causing a failure.

Add the warning as a known controller log message. The warning will be
printed as a skipped test, allowing the integration tests to pass.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-30 13:38:59 +01:00
Andrew Seigner 15ffd86cf1
Introduce multi-stage upgrade (#2723)
`linkerd install` supports a 2-stage install process, `linkerd upgrade`
did not.

Add 2-stage support for `linkerd upgrade`. Also exercise multi-stage
functionality during upgrade integration tests.

Part of #2337

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-25 14:29:52 -07:00
Alejandro Pedraza 53bb7c47f6
Make the auto-injector required and removed proxy-auto-inject flag (#2733)
Make the auto-injector required and removed proxy-auto-inject flag

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-04-24 13:06:51 -05:00
Alejandro Pedraza 62d9a80894
New `linkerd inject` default and manual modes (#2721)
Fixes #2720 and 2711 

This changes the default behavior of `linkerd inject` to not inject the
proxy but just the `linkerd.io/inject: enabled` annotation for the
auto-injector to pick it up (regardless of any namespace annotation).

A new `--manual` mode was added, which behaves as before, injecting
the proxy in the command output.

The unit tests are running with `--manual` to avoid any changes in the
fixtures.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-04-24 09:05:27 -05:00
Andrew Seigner ebbb55cf6b
Report known logging errors in test output (#2724)
The integration tests check container logs for errors. When an error is
encountered that matches a list of expected errors, it was hidden, and
the test passed.

Modify the integration tests to report known errors in logs via
`t.Skipf`.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-19 14:22:35 -07:00
Ivan Sim 8d13084f94
Split the `linkerd-version` CLI flag into `control-plane-version` and `proxy-version` (#2702)
* The 'linkerd-version' CLI flag is renamed to 'control-plane-version'
* Add version field to proxy config
* Add the control plane version to the global config
* Unit test for init image version
* Use more specific control plane and proxy versions in unit tests

Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-04-19 11:35:20 -07:00
Andrew Seigner 8323e104fb
Introduce upgrade --from-manifests flag (#2697)
The `linkerd upgrade` command read the control-plane's config from
Kubernetes, which required the environment to be configured to connect
to the appropriate k8s cluster.

Intrdouce a `linkerd upgrade --from-manifests` flag, allowing the user
to feed the output of `linkerd install` into the upgrade command.

Fixes #2629

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-17 13:32:21 -07:00
Ivan Sim 1c0f147718
Integration test for the 'upgrade' command (#2679)
Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-04-11 19:37:50 -07:00
Andrew Seigner 46d1490f98
Skip proxy logging errors in integration tests (#2647)
The list of known proxy log errors has been growing, and causing regular
ci failures.

Skip proxy logging errors. The tests will continue to run and report
unexpected errors, but this will not fail the tests (and ci). Also break
out the controller log errors separately, and continue to fail on those.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-10 16:43:56 -07:00
Alejandro Pedraza edb225069c
Add validation webhook for service profiles (#2623)
Add validation webhook for service profiles

Fixes #2075

Todo in a follow-up PRs: remove the SP check from the CLI check.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-04-05 16:10:47 -05:00
Andrew Seigner 2f80add17a
Introduce inject integration tests (#2616)
This change introduces integration tests for `linkerd inject`. The tests
perform CLI injection, with and without params, and validates the
output, including annotations.

Also add some known errors in logs to `install_test.go`.

TODO:
- deploy uninjected and injected resources to a default and
  auto-injected cluster
- test creation and update

Part of #2459

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-05 11:42:49 -07:00
Andrew Seigner a3bba0e143
Fix logging regex to handle any addr (#2619)
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-02 12:47:38 -07:00
Andrew Seigner a21c7be9f5
Fix ci logging errors (#2617)
Introduce some additional known logging errors to the integration tests

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-02 11:24:30 -07:00
Andrew Seigner b454f8fbc1
Introduce auto inject integration tests (#2595)
The integration tests were not exercising proxy auto inject.

Introduce a `--proxy-auto-inject` flag to `install_test.go`, which
now exercises install, check, and smoke test deploy for both manual and
auto injected use cases.

Part of #2569

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-04-01 10:32:56 -07:00
Andrew Seigner 9eab0e28a6
Introduce ServiceProfile integration tests (#2588)
The existing integration tests were not validating ServiceProfile
functionality.

Introduce ServiceProfile integration tests that:
- install control-plane ServiceProfiles via `linkerd install-sp`
- install smoke-test ServiceProfiles via `linkerd profile --proto`
- validate well-formed ServiceProfiles via `linkerd check`
- validate `linkerd routes` returns expected output

Fixes #2520

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-29 10:52:54 -07:00
Oliver Gould 34ea302a32
inject: Configure proxies to enable Identity (#2536)
This change adds a new `linkerd2-proxy-identity` binary to the `proxy`
container image as well as a `linkerd2-proxy-run` entrypoint script.

The inject process now sets environment variables on pods to support
identity, including identity names for the destination and identity
services.

As the proxy starts, the identity helper creates a key and CSR in a
tmpfs. As the proxy starts, it reads these files, as well as a
serviceaccount token, and provisions a certificate from controller.
The proxy's /ready endpoint will not succeed until a certificate has
been provisioned.

The proxy will not participate in identity with services other than the
controllers until the Destination controller is modified to provide
identities via discovery.
2019-03-21 18:39:05 -07:00
Kevin Lingerfelt 0d4eb02835
Add identity pod to check, web, and integration tests (#2529)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-03-19 20:49:31 -07:00
Oliver Gould 91c5f07650
proxy: Upgrade to identity-capable proxy (#2524)
The new proxy has changed its configuration as follows:

- `LISTENER` urls are now `LISTEN_ADDR` addresses;
- `CONTROL_URL` is now `DESTINATION_SVC_ADDR`;
- `*_NAMESPACE` vars are no longer needed;
- The `PROXY_ID` is now the `DESTINATION_CONTEXT`;
- The "metrics" port is now the "admin" port, since it serves more than
  just metrics;
- A readiness probe now checks a dedicated /ready endpoint eagerly.

Identity injection is **NOT** configured by this branch.
2019-03-19 14:20:39 -07:00
Oliver Gould 81f645da66
Remove `--tls=optional` and `linkerd-ca` (#2515)
The proxy's TLS implementation has changed to use a new _Identity_ controller.

In preparation for this, the `--tls=optional` CLI flag has been removed
from install and inject; and the `ca` controller has been deleted. Metrics
and UI treatments for TLS have **not** been removed, as they will continue to
be valuable for the new Identity system.

With the removal of the old identity scheme, the Destination service's proxy
ID field is now set with an opaque string (e.g. `ns:emojivoto`) to enable
locality awareness.
2019-03-18 17:40:31 -07:00
Andrew Seigner e5d2460792
Remove single namespace functionality (#2474)
linkerd/linkerd2#1721 introduced a `--single-namespace` install flag,
enabling the control-plane to function within a single namespace. With
the introduction of ServiceProfiles, and upcoming identity changes, this
single namespace mode of operation is becoming less viable.

This change removes the `--single-namespace` install flag, and all
underlying support. The control-plane must have cluster-wide access to
operate.

A few related changes:
- Remove `--single-namespace` from `linkerd check`, this motivates
  combining some check categories, as we can always assume cluster-wide
  requirements.
- Simplify the `k8s.ResourceAuthz` API, as callers no longer need to
  make a decision based on cluster-wide vs. namespace-wide access.
  Components either have access, or they error out.
- Modify the web dashboard to always assume ServiceProfiles are enabled.

Reverts #1721
Part of #2337

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-12 00:17:22 -07:00
Andrew Seigner 38288b0688
README and test updates (#2467)
Add another known log error to the integration tests.
Also bump README copyright to 2019

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-07 14:36:41 -08:00
Andrew Seigner a3d84eae7f
Add more known log errors to integration tests (#2457)
Relates to #2414, #2452

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-06 12:58:00 -08:00
Andrew Seigner 756a1312fd
Add more known log errors to integration tests (#2452)
linkerd/linkerd2#2414 introduced integration tests to ensure logs did
not contain unexpected errors. Additional errors are not being caught,
causing ci to fail.

This change adds more known log errors to the log regex.

Also temporarily enable integration tests in ci for this PR.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-06 10:16:48 -08:00
Andrew Seigner d850b02b66
Introduce logging and restart integration tests (#2414)
The integration tests deploy complete Linkerd environments into
Kubernetes, but do not check if the components are logging errors or
restarting.

Introduce integration tests to validation that all expected
control-plane containers (including `linkerd-proxy` and `linkerd-init`)
are found, logging no errors, and not restarting.

Fixes #2348

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-03-05 19:49:38 -08:00
Andrew Seigner 10d9b7e493
Revert integration test check wait (#2400)
linkerd/linkerd2#2360 modified the `linkerd check --wait` param from `0`
to `1m`. Waiting on a check command causes spinner control characters in
the output, making output validation non-trivial.

Instead, revert the wait param back to `0`, and use
`TestHelper.RetryFor`.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-02-26 16:37:29 -08:00
Andrew Seigner e300309af5
Increase integration test timeouts (#2360)
The integration tests occasionally timeout in ci when talking to
Kubernetes and Linkerd:
https://travis-ci.org/linkerd/linkerd2/jobs/497300669#L972
https://travis-ci.org/linkerd/linkerd2/jobs/497329339#L7284

Increase `linkerd check --wait` from `0` to `30s`.
Increase `HTTPGetURL` timeout from 30s to 1 minute.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-02-23 13:54:02 -08:00
Oliver Gould 71ce786dd3
Rename linkerd-proxy-api to linkerd-destination (#2281)
Up until now, the proxy-api controller service has been the sole service
that the proxy communicates with, implementing the majoriry of the API
defined in the `linkerd2-proxy-api` repo. But this is about to change:
linkerd/linkerd2-proxy-api#25 introduces a new Identity service; and
this service must be served outside of the existing proxy-api service
in the linkerd-controller deployment (so that it may run under a
distinct service account).

With this change, the "proxy-api" name becomes less descriptive. It's no
longer "the service that serves the API for the proxy," it's "the
service that serves the Destination API to the proxy." Therefore, it
seems best to bite the bullet and rename this to be the "destination"
service (i.e. because it only serves the
`io.linkerd.proxy.destination.Destination` service).

Co-authored-by: Kevin Lingerfelt <kl@buoyant.io>
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2019-02-15 15:11:04 -08:00