Commit Graph

1755 Commits

Author SHA1 Message Date
Alejandro Pedraza 0e8958cd07
Fixed bad identity string for target pod in tap (#3675)
* Fixed bad identity string for target pod in tap

Fixes #3506

Was using the cluster domain instead of the trust domain, which results
in an error when those domains differ.
2019-11-05 15:57:41 -05:00
Mayank Shah e91f2020db Update uninject command to handle namespaces (Fixes #3648) (#3668)
* Add support for uninject command to uninject namespace configs
* Add relevant unit tests in cli/cmd/uninject_test.go

Signed-off-by: Mayank Shah <mayankshah1614@gmail.com>
2019-11-04 22:21:47 -08:00
StupidScience 5958111533 WIP: Added annotations parsing and doc generation (#3564)
* rework annotations doc generation from godoc parsing to map[string]string and get rid of unused yaml tags
* move annotations doc function from pkg/k8s to cli/cmd

Signed-off-by: StupidScience <tonysignal@gmail.com>
2019-11-04 14:55:50 -08:00
Zahari Dichev 1bb9d66757 Integration test for custom cluster domain (#3660)
Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-11-04 14:49:52 -08:00
Joakim Roubert 80d644eb1d docker-build-proxy: make apt work behind proxy (#3643)
This patch sends the proxy settings to docker build if present.
Without this, the docker build will fail on apt-get update on a
system that is behind a proxy.

Change-Id: I3fcbad4d9a9c30e5f0a00f03c6d8629ed8cc97b0
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-11-04 13:17:44 -08:00
Zahari Dichev 86854ac845
Control plane debug (#3507)
* Add cmd to inject debug sidecar for l5d components only

Signed-off-by: zaharidichev <zaharidichev@gmail.com>

* Revert "Add cmd to inject debug sidecar for l5d components only"

This reverts commit 50b8b3577e.

Signed-off-by: zaharidichev <zaharidichev@gmail.com>

* Stop uninjecting metadata from control plane components

Signed-off-by: zaharidichev <zaharidichev@gmail.com>

* Ensure inject can be run on control plane components only if --manual is present

Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-11-04 18:56:35 +02:00
Eliza Weisman 92532bc0b3
update changelog for edge-19.10.5 (#3658)
## edge-19.10.5

This edge release adds support for integrating Linkerd's public-key
infrastructure with an external certificate issuer such as [`cert-manager`],
adds distributed tracing support to the Linkerd control plane, and adds
protection against DNS rebinding attacks to the web dashboard. In addition, it
includes several improvements to the Linkerd CLI.

* CLI
  * Added a new `--identity-external-issuer` flag to `linkerd install` that
    configures Linkerd to use certificates issued by an external certificate
    issuer (such as `cert-manager`)
  * Added support for injecting a namespace to `linkerd inject` (thanks
    @mayankshah1607!)
  * Added checks to `linkerd check --preinstall` ensuring Kubernetes Secrets
    can be created and accessed
  * Fixed `linkerd tap` sometimes displaying incorrect pod names for unmeshed
    IPs that match multiple running pods
* Controller
  * Added support for using trust anchors from an external certificate issuer
    (such as `cert-mananger`) to the `linkerd-identity` service
* Web UI
  * Added `Host:` header validation to the `linkerd-web` service, to protect
    against DNS rebinding attacks
* Internal
  * Added new `--trace-collector` and `--trace-collector-svc-account` flags to
    `linkerd inject` that configures the OpenCensus trace collector used by
    proxies in the injected workload (thanks @Pothulapati!)
  * Added a new `--control-plane-tracing` flag to `linkerd install` that enables
    distributed tracing in the control plane (thanks @Pothulapati!)
  * Added distributed tracing support to the control plane (thanks
    @Pothulapati!)

Also, thanks to @joakimr-axis for several fixes and improvements to internal
build scripts!
2019-11-01 10:27:48 -07:00
Alejandro Pedraza bd8d47226d
DNS rebinding protection for the dashboard (#3644)
* DNS rebinding protection for the dashboard

Fixes #3083 and replacement for #3629

This adds a new parameter to the `linkerd-web` container `enforcedHost`
that establishes the regexp that the Host header must enforce, otherwise
it returns an error.

This parameter will be hard-coded for now, in `linkerd-web`'s deployment
yaml.

Note this also protects the dashboard because that's proxied from
`linkerd-web`.

Also note this means the usage of `linkerd dashboard --address` will
require the user to change that parameter in the deployment yaml (or
have Kustomize do it).

How to test:
- Run `linkerd dashboard`
- Go to http://rebind.it:8080/manager.html and change the target port to
50750
- Click on “Start Attack” and wait for a minute.
- The response from the dashboard will be returned, showing an 'Invalid
Host header' message returned by the dashboard. If the attack would have
succeeded then the dashboard's html would be shown instead.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-10-31 11:51:25 -05:00
Alejandro Pedraza 8cf4494e78
Add proxy-injector-injections count to heartbeat (#3655)
Fixes #3059
2019-10-31 11:09:00 -05:00
Zahari Dichev a8170bd634
Add preinstall checks for deletion and creation of secrets (#3639)
Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-10-31 18:01:03 +02:00
Joakim Roubert 478145ce45 Fix whitespace path handling in docker (build) scripts (#3634)
Handling of whitespace paths was not fully implemented; this patch adds
the missing pieces. Also, only use bash where bash-specific
functionality is used/needed.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-30 15:55:38 -07:00
William Morgan 6129c30c4b sort ADOPTERS.md and add orgs that are speaking at Kubecon NA 2019 (#3654)
Signed-off-by: William Morgan <william@buoyant.io>
2019-10-30 12:55:27 -07:00
Alex Leong befea4aff6
Add direct edges integration test (#3603)
Add an integration test which exercises the behavior when one meshed pod connects to another meshed pod by pod ip address.

The current behavior is that the Linkerd proxy will not do any lookup against the destination service for this kind of connection and will proxy directly to the SO_ORIG_DST.  This means that it will not have the identity metadata necessary to TLS the connection, and the connection will not be present in the `linkerd edges` command output.  This test validates that behavior.

The purpose of this test is to set the stage for future work which will allow the Linkerd proxy to TLS this type of connection and display it in `linkerd edges`.  The assertions in this test will be updated as part of that work.

This test will be run as part of the integration test suite.  It can also be run directly:

```
go test --failfast --mod=readonly test/install_test.go   --linkerd=(pwd)"/bin/linkerd" --k8s-context="$CTX" --integration-tests
go test -v --mod=readonly test/edges/edges_test.go  --linkerd=(pwd)"/bin/linkerd" --k8s-context="$CTX" --integration-tests
```

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-10-30 10:48:03 -07:00
Mayank Shah ec848d4ef3 Add inject support for namespace configs (Fix #3255) (#3607)
* Add inject support for namespaces(Fix #3255)

* Add relevant unit tests (including overridden annotations)

Signed-off-by: Mayank Shah <mayankshah1614@gmail.com>
2019-10-30 10:18:01 -05:00
Joakim Roubert b5309fad04 build-cli-bin: Use case for host_platform selection (#3626)
Increase readability and extensibility.

Change-Id: I0670950e14b59da0971397d08016176650602247
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-28 16:49:56 -05:00
Joakim Roubert 3411e22bdc fetch-proxy: Make POSIX compatible (#3625)
* fetch-proxy: Make POSIX compatible
* fetch-proxy: Update old comment to match current behavior

Getting the directory where the script resides can easily be done
without bash-specific functionality, and hence the script can be POSIX
compatible.

Change-Id: I30bd69dccbc950bdce3dc5da4bea279305a7b1f9
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-28 16:45:23 -05:00
Joakim Roubert 0341af86e8 build-cli-bin: POSIX compatible & handle whitespace paths (#3623)
Getting the directory where the script resides can easily be done
without bash-specific functionality, and hence the script can be POSIX
compatible. Also adding the missing pieces for handling paths with
whitespaces.

Change-Id: Ie2e867929be0322e476342438d9cf4a3d36f58f1
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-10-28 16:36:53 -05:00
Tarun Pothulapati 015ea9e17a Control Plane Trace configuration (#3539)
* add Control Plane Trace config
* remove collector and jaeger templates
* add linting fixes
* add trace tpl to helm tests
* add build docs to enable tracing
* fix the install command
* remove sampling
* add templated namespace
* simplify config and use templating
* hide the tracing flag
* add correct link
* fix the link

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2019-10-25 11:42:30 -07:00
Alejandro Pedraza d3d8266c63
If tap source IP matches many running pods then only show the IP (#3513)
* If tap source IP matches many running pods then only show the IP

When an unmeshed source ip matched more than one running pod, tap was
showing the names for all those pods, even though the didn't necessary
originate the connection. This could be reproduced when using pod
network add-on such as Calico.

With this change, if a node matches, return it, otherwise we proceed to look for a matching pod. If exactly one running pod matches we return it. Otherwise we return just the IP.

Fixes #3103
2019-10-25 12:38:11 -05:00
Zahari Dichev 0017f9a60a Cert manager support (#3600)
* Add support for --identity-issuer-mode flag to install cmd
* Change flag to be a bool
* Read correct data form identity when external issuer is used
* Add ability for identity service to dynamically reload certs
* Fix failing tests
* Minor refactor
* Load trust anchors from identity issuer secret
* Make identity service actually watch for issuer certs updates
* Add some testing around cmd line identity options validation
* Add tests ensuring that identity service loads issuer
* Take into account external-issuer flag during upgrade + tests
* Fix failing upgrade test
* Address initial review feedback
* Address further review feedback on cli and helm
* Do not persist --identity-external-issuer
* Some improvements to identitiy service
* Bring back persistane of external issuer flag
* Address more feedback
* Update dockerfiles shas
* Publishing k8s events on issuer certs rotation
* Ensure --ignore-cluster+external issuer is not supported
* Update go-deps shas
* Transition to identity issuer scheme based configuration
* Use k8s consts for secret file names

Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-10-24 13:15:14 -07:00
Tarun Pothulapati 78b6f42ea7 Add Collector Flags for inject cmd (#3588)
* add flags to inject cmd
* add trace flags to readme
* use ns from pod

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2019-10-24 10:16:13 -07:00
Zahari Dichev b7207a2d8c
Revert "proxy: v2.76.0 (#3593)" (#3636)
This reverts commit 2c758154cf.

Signed-off-by: zaharidichev <zaharidichev@gmail.com>
2019-10-24 18:46:26 +03:00
Oliver Gould 2c758154cf proxy: v2.76.0 (#3593)
* proxy: v2.76.0

This release does not impact any user-facing behavior. The proxy's
internals have been restructured.

---

* Update maintainers.md (linkerd/linkerd2-proxy#366)
* internal: Split Accept from Listen (linkerd/linkerd2-proxy#368)
* internal: Remove the `ClientUsedTls` response extension (linkerd/linkerd2-proxy#370)
* internal: Split transport utilities into a subcrate (linkerd/linkerd2-proxy#369)
* Audit Cargo.lock for unused and outdated crates (linkerd/linkerd2-proxy#373)
* Adopt tokio-tracing contexts (linkerd/linkerd2-proxy#374)
* internal: Spilt app from linkerd2-proxy (linkerd/linkerd2-proxy#375)
* ci: Run docker builds on linkerd-docker host (linkerd/linkerd2-proxy#376)
* Update to Rust 1.38.0 (linkerd/linkerd2-proxy#377)

* fixup! proxy: v2.76.0
2019-10-24 09:56:26 +03:00
Zahari Dichev 9fde1c2594 Release notes for edge-19.10.4 (#3628)
* Release notes for edge-19.10.4

Signed-off-by: zaharidichev <zaharidichev@gmail.com>

* updates based on reviews

Signed-off-by: Charles Pretzer <charles@buoyant.io>
2019-10-23 16:37:33 -07:00
Alejandro Pedraza 397970e917
Replace actions/checkout with actions/upload/download (#3602)
* Replace actions/checkout with actions/upload/download

Signed-off-by: Alejandro Pedraza Borrero <alejandro@buoyant.io>
2019-10-23 17:22:59 -05:00
Andrew Seigner 0f9ea553d2 Add APIService fake clientset support (#3569)
The `linkerd upgrade --from-manifests` command supports reading the
manifest output via `linkerd install`. PR #3167 introduced a tap
APIService object into `linkerd install`, but the manifest-reading code
in fake.go was never updated to support this new object kind.

Update the fake clientset code to support APIService objects.

Fixes #3559

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-10-21 12:12:19 -07:00
Andrew Seigner 3b3dfa701c
Faster `linkerd install --ignore-cluster` (#3568)
The `linkerd install` `--ignore-cluster` and `--skip-checks` flags
enable generating install manifests without a connection to a k8s
cluster. Unfortunately these flags were only checked after attempted
connections to a k8s cluster were made. This satisfied the use case of
`linkerd install` "ignoring" the state of the cluster, but for
environments not connected to a cluster, the user would have to wait for
30s timeouts before getting the manifests.

Modify `linkerd install` and its subcommands to pre-emptively check for
`--ignore-cluster` and `--skip-checks`. This decreases `linkerd install
--ignore-cluster` from ~30s to ~1s, and `linkerd install control-plane
--ignore-cluster --skip-checks` from ~60s to ~1s.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-10-21 11:05:16 -07:00
Tarun Pothulapati f3deee01b6 Trace Control plane Components with OC (#3495)
* add trace flags and initialisation
* add ocgrpc handler to newgrpc
* add ochttp handler to linkerd web
* add flags to linkerd web
* add ochttp handler to prometheus handler initialisation
* add ochttp clients for components
* add span for prometheus query
* update godep sha
* fix reviews
* better commenting
* add err checking
* remove sampling
* add check in main
* move to pkg/trace

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2019-10-18 12:19:13 -07:00
Oliver Gould 87e03ae940
Update proxy update commit messages with tag info (#3594)
Each proxy release tag now includes a message.

This change updates the git-commit-proxy-version script to include this
message in the commit message in this repo.
2019-10-18 10:20:38 -07:00
Carol A. Scott 941fa3a6ed
Responsive dashboard sidebar behavior and refactoring Navigation component (#3547)
This PR improves the dashboard sidebar behavior for mobile, tablet and desktop
views, refactors the Navigation component, and changes navbar color to the color
of the linkerd.io website.
2019-10-18 10:14:47 -07:00
cpretzer 7a21297d1a
Release notes for edge-19.10.3 (#3598)
* Release notes for edge-19.10.3

Signed-off-by: Charles Pretzer <charles@buoyant.io>
2019-10-17 14:55:53 -07:00
Alex Leong e4f8c76af7
Add more detail to CONTRIBUTING.md about pull request descriptions (#3591)
Signed-off-by: Alex Leong <alex@buoyant.io>
2019-10-16 18:38:16 -07:00
Alejandro Pedraza e76c5c3d9d
Keep old releases in Helm repo index (#3589)
* Keep old releases in Helm repo index

When building the Helm repo index file, keep the references to the old
releases. Also rename and keep the old index file in case
something goes wrong when generating the new one.

Fixes #3561
2019-10-16 17:21:53 -05:00
Alex Leong 3dcff52b9f
Switch from using golangci fmt to using goimports (#3555)
CI currently enforcing formatting rules by using the fmt linter of golang-ci-lint which is invoked from the bin/lint script.  However it doesn't seem possible to use golang-ci-lint as a formatter, only as a linter which checks formatting.  This means any formatter used by your IDE or invoked manually may or may not use the same formatting rules as golang-ci-lint depending on which formatter you use and which specific revision of that formatter you use.  

In this change we stop using golang-ci-lint for format checking.  We introduce `tools.go` and add goimports to the `go.mod` and `go.sum` files.  This allows everyone to easily get the same revision of goimports by running `go install -mod=readonly golang.org/x/tools/cmd/goimports` from inside of the project.  We add a step in the CI workflow that uses goimports via the `bin/fmt` script to check formatting.

Some shell gymnastics were required in the `bin/fmt` script to work around some limitations of `goimports`:
* goimports does not have a built-in mechanism for excluding directories, and we need to exclude the vendor director as well as the generated Go sources
* goimports returns a 0 exit code, even when formatting errors are detected

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-10-16 13:56:11 -07:00
Carol A. Scott 7aeee3bbae
Updating clean-webpack-plugin and other webpack dependencies (#3575)
Update webpack and other webpack-related dependencies
2019-10-16 11:25:21 -07:00
Saurav Tiwary 1e44513f30 Clean username before using as docker image tag (#3572)
* Clean username before using as docker image tag
* Allow Alphanumerics instead of just alphabets in docker image tag
Incorporate Alex's suggestions

Fixes #3570 

Signed-off-by: Saurav Tiwary <srv.twry@gmail.com>
2019-10-15 16:36:48 -07:00
Ivan Sim ff69c29f5e
Add missing package to proxy Dockerfile (#3583)
* Add missing package to proxy Dockerfile
* Fix failing 'check' integration test
* Trim whitespaces in certs comparison.

Without this change, the integration test would fail because the trust anchor
stored in the linkerd-config config map generated by the Helm renderer is
stripped of the line breaks. See charts/linkerd2/templates/_config.tpl

Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-10-15 15:51:26 -07:00
Johannes Hansen f880e71fcd The linkerd proxy does not work with headless services (#3470)
* The linkerd proxy does not work with headless services (i.e. endpoints not referencing a pod).

Changed endpoints_watcher to also return endpoints with no targetref.

Fixes #3308

Signed-off-by: Johannes Hansen <johannesh1980@gmail.com>

* Fix panic in endpoint_translator

Signed-off-by: Johannes Hansen <johannesh1980@gmail.com>
2019-10-15 14:56:41 -07:00
Alex Leong ef54d18bb7
Fallback to defaults when config cannot be loaded (#3530)
When running the destination controller locally, the Linkerd config files which are typically mounted from a configmap are not available.  To facilitate local development, we fall back to default values in this case instead of failing to start up.

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-10-15 14:47:42 -07:00
Guangming Wang c59e9cf500 move t.Fatalf out of goroutine in server_test.go (#3490)
Subject
t.Fataf should not be called in goroutine

Problem

Solution
move t.Fatalf into testing func instead of its goroutine

Validation
unit test passed on my env

Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-10-15 14:22:10 -07:00
Saurav Tiwary d95a469a60 Correct definition of Less function in CLI's metrics command(#3533) (#3534)
Fixes #3533

Signed-off-by: Saurav Tiwary <srv.twry@gmail.com>
2019-10-15 14:21:10 -07:00
Bruno M. Custódio df48873da8 Make '--cluster-domain' an install-only flag. (#3496)
This PR aims at preventing `--cluster-domain` from being changed during `linkerd upgrade`. I am not sure this is all that is necessary, but it can probably be at least a good start. 🙂 Closes #3454.

Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
2019-10-15 14:09:33 -07:00
Rafael Fernández López ba14dc3fc7 Health check: check if proxies trust anchors match configuration (#3524)
* Health check: check if proxies trust anchors match configuration

If Linkerd is reinstalled or if the trust anchors are modified while
proxies are running on the cluster, they will contain an outdated
`LINKERD2_PROXY_IDENTITY_TRUST_ANCHORS` certificate.

This changeset adds support for `linkerd check`, so it checks if there
is any proxy running on the cluster, and performing the check against
the configuration trust anchor. If there's a failure (considered a
warning), `linkerd check` will notify the user about what pods are the
offenders (and in what namespace each one is), and also a hint to
remediate the issue (restarting the pods).

* Add integration tests for proxy certificate check

Fixes #3344

Signed-off-by: Rafael Fernández López <ereslibre@ereslibre.es>
2019-10-15 11:33:09 -07:00
Alejandro Pedraza 3de35ccc58
Remove Discovery service leftovers (#3500)
Followup to #2990, which refactored `linkerd endpoints` to use the
`Destination.Get` API instead of the `Discovery.Endpoints` API, leaving
the Discovery with no implented methods. This PR removes all the Discovery
code leftovers.

Fixes #3499
2019-10-15 11:20:21 -05:00
ekapratama93 8f36325c90 add Kurio as adopter (#3535)
Signed-off-by: ekapratama93 <ekapratama93@gmail.com>
2019-10-15 08:45:19 -07:00
Carol A. Scott 1039d82547
CHANGES.md and values.yaml for stable-2.6.0 (#3529)
Change notes for stable-2.6.0
2019-10-10 10:51:17 -07:00
Carol A. Scott 3b926023b0
Change notes for edge-19.10.2 (#3553) 2019-10-09 11:18:34 -07:00
Ivan Sim cf69dedf9c
Re-add the destination container to the controller spec (#3540)
* Re-add the destination container to the controller spec

This fix is necessary to avoid data plane downtime during an upgrade to
stable-2.6. All existing older proxies will continue to send requests to
this destination container, until the data plane is restarted.

On restart, the new pods will start forwarding their requests to the new
linkerd-dst service.

* Use the 2.6 destination service fqdn
* Fixed unit tests
* Fix integration test failure

Signed-off-by: Ivan Sim <ivan@buoyant.io>
2019-10-08 10:49:40 -07:00
Alejandro Pedraza c5d68ecb16
Add missing nodeSelector in Destination deployment (#3527)
Fixes #3526
2019-10-04 12:47:55 -05:00
Carol A. Scott 9e287ace3b
Change notes for edge-19.10.1 (#3522)
Updating CHANGES.md and values.yaml
2019-10-03 11:11:42 -07:00