Commit Graph

47 Commits

Author SHA1 Message Date
Oliver Gould ad2bbe7f19
policy-controller: Use rustls on ARM (#7320)
We can't easily cross-compile the policy controller using openssl; so
this change modifies the docker images to forcefully enable the rustls
feature.
2021-11-18 11:41:19 -08:00
dependabot[bot] b0a799eee7
build(deps): bump kube from 0.63.2 to 0.64.0 (#7299)
* build(deps): bump kube from 0.63.2 to 0.64.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.63.2 to 0.64.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kube-rs/kube-rs/compare/0.63.2...0.64.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Fixup deny.toml for deduped deps

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver Gould <ver@buoyant.io>
2021-11-17 09:16:13 -05:00
Oliver Gould c00ae7c3d7
build(deps): bump various dependencies (#7288)
* build(deps): bump various dependencies

It's unclear why dependabot didn't catch these updates, but `cargo
update` updates a variety of depdencies:

    Updating crates.io index
    Updating bumpalo v3.7.0 -> v3.8.0
    Updating cc v1.0.70 -> v1.0.72
    Updating core-foundation v0.9.1 -> v0.9.2
    Updating core-foundation-sys v0.8.2 -> v0.8.3
    Updating h2 v0.3.4 -> v0.3.7
    Updating headers v0.3.4 -> v0.3.5
    Updating instant v0.1.10 -> v0.1.12
    Updating js-sys v0.3.54 -> v0.3.55
    Updating kube-client v0.63.1 -> v0.63.2
    Updating kube-core v0.63.1 -> v0.63.2
    Updating kube-derive v0.63.1 -> v0.63.2
    Updating kube-runtime v0.63.1 -> v0.63.2
    Updating libc v0.2.101 -> v0.2.107
    Updating mio v0.7.13 -> v0.7.14
    Updating openssl v0.10.36 -> v0.10.38
    Updating openssl-sys v0.9.66 -> v0.9.70
    Updating pkg-config v0.3.19 -> v0.3.22
    Updating ppv-lite86 v0.2.10 -> v0.2.15
    Updating proc-macro2 v1.0.29 -> v1.0.32
    Updating sharded-slab v0.1.3 -> v0.1.4
    Updating slab v0.4.4 -> v0.4.5
    Updating socket2 v0.4.1 -> v0.4.2
    Updating syn v1.0.80 -> v1.0.81
    Updating thiserror v1.0.29 -> v1.0.30
    Updating thiserror-impl v1.0.29 -> v1.0.30
    Updating tokio-macros v1.3.0 -> v1.5.1
    Updating tokio-stream v0.1.7 -> v0.1.8
    Updating tokio-util v0.6.8 -> v0.6.9
    Updating tower v0.4.8 -> v0.4.10
    Updating tower-http v0.1.1 -> v0.1.2
    Updating unicode-width v0.1.8 -> v0.1.9
    Updating wasm-bindgen v0.2.77 -> v0.2.78
    Updating wasm-bindgen-backend v0.2.77 -> v0.2.78
    Updating wasm-bindgen-macro v0.2.77 -> v0.2.78
    Updating wasm-bindgen-macro-support v0.2.77 -> v0.2.78
    Updating wasm-bindgen-shared v0.2.77 -> v0.2.78
    Updating web-sys v0.3.54 -> v0.3.55

* Disable structopt's default features

Eliminates duplicate dependencies on `ansi_term` and `strsim`.
2021-11-16 09:38:59 -05:00
Oliver Gould b8064eefb7
policy-controller: Use `openssl` instead of `rustls` (#7276)
The Rustls/Ring/Webpki crates have issues communicating with a variety
of Kubernetes clusters. This change modifes the policy-controller's
default TLS implementation to use `libssl` (as provided by the
`distroless:base` container image).
2021-11-15 11:54:42 -08:00
cpretzer b3150c4f18
Add control plane namespace arg to policy controller (#7206)
The policy controller synthesizes identity strings based on service account
names; but it assumed that `linkerd` was the name of the control plane
namespace. This change updates the policy controller to take a
`--control-plane-namespace` command-line argument to set this value in
identity strings. The helm templates have been updated to configure the policy
controller appropriately.

Fixes #7204

Co-authored-by: Oliver Gould <ver@buoyant.io>
2021-11-05 11:24:54 -07:00
Oliver Gould b2392b2b27
Update to kube v0.63 (#7170)
* Update to kube v0.63
2021-10-29 08:58:34 -05:00
Oliver Gould c88c0edd15
Update minimum-supported K8s version to v1.20 (#7172)
Kubernetes v1.19 is reaching its end-of-life date on 2021-10-28. In
anticipation of this, we should explicitly update our minimum supported
version to v1.20. This allows us keep our dependencies up-to-date and
ensures that we can actually test against our minimum supported version.

Fixes #7171

Co-authored-by: Alejandro Pedraza <alejandro@buoyant.io>
2021-10-28 13:19:10 -07:00
Oliver Gould 818a162dd2
policy-controller: Update tonic (#7169)
linkerd2-proxy-api v0.3.0 has been released to depend on tonic v0.6 and
prost v0.9.
2021-10-28 10:08:18 -05:00
dependabot[bot] 5bdbd7ed88
build(deps): bump tracing-subscriber from 0.2.25 to 0.3.1 (#7153)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.25 to 0.3.1.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.25...tracing-subscriber-0.3.1)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 13:49:16 -05:00
Oliver Gould aaa6091ea8
policy-controller: Use jemalloc on x86_64 gnu/linux (#7138)
While testing the proxy with various allocators, we've seen that
jemalloc generally uses less memory without incurring CPU or latency
costs.

This change updates the policy-controller to use jemalloc on x86_64
gnu/linux. We continue to use the system allocator on other platforms
(especially arm), since the jemalloc tests do not pass on these
platforms (according to the jemallocator readme).
2021-10-22 13:39:23 -07:00
Oliver Gould 5cbad1fdb4
Update Rust to v1.56.0 (#7136)
Adopt the [2021 edition][ed2021].

[ed2021]: https://doc.rust-lang.org/edition-guide/rust-2021/index.html
2021-10-22 09:40:53 -07:00
dependabot[bot] 1b2d9dab24
build(deps): bump kube from 0.60.0 to 0.61.0 (#7074)
* build(deps): bump kube from 0.60.0 to 0.61.0

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.60.0 to 0.61.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kube-rs/kube-rs/compare/0.60.0...0.61.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* bump kube-runtime

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver Gould <ver@buoyant.io>
2021-10-12 10:38:08 -07:00
Alex Leong 6d3f00357a
Update policy CRD version to v1beta1 (#6943)
Fixes #6827

We upgrade the Server and ServerAuthorization CRD versions from v1alpha1 to v1beta1.  This version update does not change the schema at all and the v1alpha1 versions will continue to be served for now.  We also update the CLI and control plane to use the v1beta1 versions.

Signed-off-by: Alex Leong <alex@buoyant.io>
2021-09-23 11:34:04 -07:00
Matei David 71066600f7
policy: Add unit tests for `Server` indexing (#6893)
* Add label & protocol test for server
* Add authz tests for server

Signed-off-by: Matei David <matei@buoyant.io>

Co-authored-by: Oliver Gould <ver@buoyant.io>
2021-09-23 10:27:01 +01:00
Matei David 9d3980e3b1
policy: fix admission errors (#6898)
The policy controller currently logs a warning message every
time a Server resource is applied. There is a mismatch between
the format of the blob that we're trying to deserialise and the
type we are deserialising into. To fix, I've changed the
`parse_server` function to deserialise only the spec;
the function signature has also changed to return the name
of the Server as a string.

Closes #6860
2021-09-16 08:54:31 -07:00
Oliver Gould ad92e052d0
policy: Support JSON log formatting (#6888)
The policy controller only emitted logs in the default plain format.

This change adds new CLI flags to the policy-controller: `--log-format`
and `--log-level` that configure logging (replacing the `RUST_LOG`
environment variable). The helm chart is updated to configure these
flags--the `controllerLogLevel` variable is used to configure the policy
controller as well.

Example:

```
{"timestamp":"2021-09-15T03:30:49.552704Z","level":"INFO","fields":{"message":"HTTP admin server listening","addr":"0.0.0.0:8080"},"target":"linkerd_policy_controller::admin","spans":[{"addr":"0.0.0.0:8080","name":"serve"}]}
{"timestamp":"2021-09-15T03:30:49.552689Z","level":"INFO","fields":{"message":"gRPC server listening","addr":"0.0.0.0:8090"},"target":"linkerd_policy_controller","spans":[{"addr":"0.0.0.0:8090","cluster_networks":"[10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16]","name":"grpc"}]}
{"timestamp":"2021-09-15T03:30:49.567734Z","level":"DEBUG","fields":{"message":"Ready"},"target":"linkerd_policy_controller_k8s_index"}
^C{"timestamp":"2021-09-15T03:30:51.245387Z","level":"DEBUG","fields":{"message":"Received ctrl-c"},"target":"linkerd_policy_controller"}
{"timestamp":"2021-09-15T03:30:51.245473Z","level":"INFO","fields":{"message":"Shutting down"},"target":"linkerd_policy_controller"}
```

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2021-09-15 11:31:09 -07:00
Oliver Gould 2b383e4d58
policy: Detect when a server's protocol changes (#6856)
Currently, the policy controller's indexing does not detect when a
server update changes its protocol (due to an incorrect comparison).
This change fixes this comparison so that protocol hint changes are
properly honored.
2021-09-10 09:36:09 -07:00
Oliver Gould d10344423b
Update to Rust 1.55.0 (#6855) 2021-09-10 06:21:41 -07:00
Oliver Gould 867da52d99
Create a top-level Cargo workspace (#6845)
Various development tools (including Rust Analyzer and some reusable
actions) expect the root of the project to define a Cargo workspace.

In order to work more naturally with these tools, this change moves the
`Cargo.lock`, `rust-toolchain`, and `deny.toml` files to the root of the
project. A `Cargo.toml` is factored out of `policy-controller` to define
the top-level workspace.
2021-09-09 14:49:42 -07:00
Oliver Gould 21249dc1b6
policy: Do not create a default authorization for kubelet (#6833)
We initially implemented a mechanism to automatically authorize
unauthenticated traffic from each pod's Kubelet's IP. Our initial method
of determining a pod's Kubelet IP--using the first IP from its node's
pod CIDRs--is not a generally usable solution. In particular, CNIs
complicate matters (and EKS doesn't even set the podCIDRs field).

This change removes the policy controller's node watch and removes the
`default:kubelet` authorization. When using a restrictive default
policy, users will have to define `serverauthorization` resources that
permit kubelet traffic. It's probably possible to programatically
generate these authorizations (i.e. by inspecting pod probe
configurations); but this is out of scope for the core control plane
functionality.
2021-09-07 18:53:06 -07:00
Oliver Gould 493efdba84
policy: Enable Link-Time Optimizations in release builds (#6830)
We've observed noticeable (~10%) RSS & CPU improvements by enabling LTO
in the proxy release builds. This change enables this setting for the
policy controller as well.
2021-09-07 12:36:42 -07:00
dependabot[bot] e48bb02de8
build(deps): bump kube from 0.59.0 to 0.60.0 in /policy-controller (#6798)
* build(deps): bump kube from 0.59.0 to 0.60.0 in /policy-controller

Bumps [kube](https://github.com/kube-rs/kube-rs) from 0.59.0 to 0.60.0.
- [Release notes](https://github.com/kube-rs/kube-rs/releases)
- [Changelog](https://github.com/kube-rs/kube-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kube-rs/kube-rs/compare/0.59.0...0.60.0)

---
updated-dependencies:
- dependency-name: kube
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* bump kube-runtime also to `0.60` for compatiblity

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2021-09-07 11:21:20 -05:00
dependabot[bot] 55c00485c8
build(deps): bump tokio from 1.10.1 to 1.11.0 in /policy-controller (#6793)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.10.1...tokio-1.11.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-02 20:39:15 -07:00
dependabot[bot] a125f4ba5d
build(deps): bump structopt from 0.3.22 to 0.3.23 in /policy-controller (#6787)
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.22 to 0.3.23.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.22...v0.3.23)

---
updated-dependencies:
- dependency-name: structopt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 12:31:50 -06:00
dependabot[bot] 3e4f1369f5
build(deps): bump serde from 1.0.129 to 1.0.130 in /policy-controller (#6780)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.129 to 1.0.130.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.129...v1.0.130)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 15:45:32 -07:00
dependabot[bot] 4612b80151
build(deps): bump futures from 0.3.16 to 0.3.17 in /policy-controller (#6778)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.16 to 0.3.17.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.16...0.3.17)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 15:44:46 -07:00
dependabot[bot] 161b1e904e
build(deps): bump serde_json from 1.0.66 to 1.0.67 in /policy-controller (#6779)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.66 to 1.0.67.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.66...v1.0.67)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 14:37:42 -05:00
dependabot[bot] 9bb49a9826
build(deps): bump serde_yaml from 0.8.19 to 0.8.20 in /policy-controller (#6766)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.19 to 0.8.20.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.19...0.8.20)

---
updated-dependencies:
- dependency-name: serde_yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 14:31:37 -05:00
Alex Leong 2851254966
Add admission controller to policy controller (#6696)
We add a validating admission controller to the policy controller which validates `Server` resources.  When a `Server` admission request is received, we look at all existing `Server` resources in the cluster and ensure that no other `Server` has an identical selector and port.

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

Co-authored-by: Oliver Gould <ver@buoyant.io>
2021-08-27 11:26:23 -07:00
Alejandro Pedraza f8af17c444
Use default distroless image in policy (#6752)
Fixes #6743

As in #6392 for the proxy image (fixed by #6451), using the
`distroless/cc:nonroot` base image breaks the policy container in some
environments. So we're changing that to `distroless/cc`. The policy
container is already being run using a non-root user, so we're not
compromising on security.
2021-08-26 10:32:37 -05:00
dependabot[bot] 0f9aef2c24
Bump serde from 1.0.128 to 1.0.129 in /policy-controller (#6731)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.128 to 1.0.129.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.128...v1.0.129)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 14:17:05 -07:00
dependabot[bot] 45de863612
Bump tokio from 1.10.0 to 1.10.1 in /policy-controller (#6732)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.10.0...tokio-1.10.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 14:16:38 -07:00
dependabot[bot] 6cd990e807
build(deps): bump hyper from 0.14.11 to 0.14.12 in /policy-controller (#6747)
Bumps [hyper](https://github.com/hyperium/hyper) from 0.14.11 to 0.14.12.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.11...v0.14.12)

---
updated-dependencies:
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 14:16:08 -07:00
Oliver Gould 49f4af6e6b
policy: Cleanup policy response labels (#6722)
Policy controller API responses include a set of labels. These labels
are to be used in proxy m$etrics to indicate why traffic is permitted to
a pod. This permits metrics to be associated with `Server` and
ServerAuthorization` resources (i.e. for `stat`).

This change updates the response API to include a `name` label
referencing the server's name. When the policy is derived from a default
configuration (and not a `Server` instance), the name takes the form
'default:<policy>'.

This change also updates authorization labels. Defaults are encoded as
servers are, otherwise the authorization's name is set as a label. The
`tls` and `authn` labels have been removed, as they're redundant with
other labels that are already present.
2021-08-23 14:56:19 -07:00
dependabot[bot] 154ad9a228
Bump serde_yaml from 0.8.18 to 0.8.19 in /policy-controller (#6725)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.18 to 0.8.19.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.18...0.8.19)

---
updated-dependencies:
- dependency-name: serde_yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-23 13:44:17 -06:00
dependabot[bot] c1ecb0bcbd
Bump serde from 1.0.127 to 1.0.128 in /policy-controller (#6726)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.127 to 1.0.128.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.127...v1.0.128)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-23 13:43:59 -06:00
Oliver Gould a8db23e163
policy-controller: Honor pod level port annotations (#6718)
Pods may be annotated with annotations like
`config.linkerd.io/opaque-ports` and
`config.linkerd.io/proxy-require-identity-inbound-ports`--these
annotations configure default behavior that should be honored when a
`Server` does not match the workload's ports. As it stands now, the
policy controller would break opaque-ports configurations that aren't
reflected in a `Server`.

This change reworks the pod indexer to create a default server watch for
each _port_ (rather than for each pod). The cache of default server
watches is now lazy, creating watches as needed for all used
combinations of default policies. These watches are never dropped, but
there are only a few possible combinations of port configurations, so
this doesn't pose any concerns re: memory usage.

While doing this, the names used to describe these default policies are
updated to be prefixed with `default:`. This generally makes these names
more descriptive and easier to understand.
2021-08-23 12:17:56 -07:00
dependabot[bot] f874f8ee92
Bump serde_yaml from 0.8.17 to 0.8.18 in /policy-controller (#6695)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.17 to 0.8.18.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.17...0.8.18)

---
updated-dependencies:
- dependency-name: serde_yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-18 16:35:08 -07:00
dependabot[bot] 09d88893dd
Bump tracing-subscriber from 0.2.19 to 0.2.20 in /policy-controller (#6694)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.19 to 0.2.20.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.19...tracing-subscriber-0.2.20)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-18 14:47:34 -07:00
Oliver Gould d539d120a9
policy-controller: Maintain liveness on watch restart (#6692)
The policy controller's readiness and liveness admin endpoint is tied to
watch state: the controller only advertises liveness when all watches
have received updates; and after a watch disconnects liveness fails
until a new update is received.

However, in some environments--especially when the API server ends the
stream before the client gracefully reconnects--the watch terminess so
that liveness is not advertises even though the client resumes watching
resources. Because the watch is resumed with a `resourceVersion`, no
updates are provided despite the watch being reestablished, and liveness
checks fail until the pod is terminated (or an update is received).

To fix this, we modify readiness advertisements to fail only until the
initial state is acquired from all watches. After this, the controller
serves cached state indefinitely.

While diagnosing this, logging changes were needed, especially for the
`Watch` type. Watches now properly maintain logging contexts and state
transitions are logged in more cases. The signature and logging context
of `Index::run` has been updated as well. Additionally, node lookup
debug logs have been elaborated to help confirm that 'pending' messages
are benign.
2021-08-18 08:32:28 -07:00
dependabot[bot] 6415e8c6fb
Bump anyhow from 1.0.42 to 1.0.43 in /policy-controller (#6682)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.42 to 1.0.43.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.42...1.0.43)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-17 12:23:12 +01:00
dependabot[bot] 3b4c1df05f
Bump tokio from 1.9.0 to 1.10.0 in /policy-controller (#6676)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.9.0...tokio-1.10.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 11:40:44 -07:00
dependabot[bot] cfe8c440e3
Bump tonic from 0.5.0 to 0.5.2 in /policy-controller (#6660)
Bumps [tonic](https://github.com/hyperium/tonic) from 0.5.0 to 0.5.2.
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.5.0...v0.5.2)

---
updated-dependencies:
- dependency-name: tonic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 11:04:35 -07:00
Oliver Gould 79a5849f7d
Update the policy-controller release build process (#6672)
We can't use the typical multiarch docker build with the proxy:
qemu-hosted arm64/arm builds take 45+ minutes before failing due to
missing tooling--specifically `protoc`. (While there is a `protoc`
binary available for arm64, there are no binaries available for 32-bit
arm hosts).

To fix this, this change updates the release process to cross-build the
policy-controller on an amd64 host to the target architecture. We
separate the policy-controller's dockerfiles as `amd64.dockerfile`,
`arm64.dockerfile`, and `arm.dockerfile`. Then, in CI we build and push
each of these images individually (in parallel, via a build matrix).
Once all of these are complete, we use the `docker manifest` CLI tools
to unify these images into a single multi-arch manifest.

This cross-building approach requires that we move from using
`native-tls` to `rustls`, as we cannot build against the platform-
appropriate native TLS libraries. The policy-controller is now feature-
flagged to use `rustls` by default, though it may be necessary to use
`native-tls` in local development, as `rustls` cannot validate TLS
connections that target IP addresses.

The policy-controller has also been updated to pull in `tracing-log` for
compatibility with crates that do not use `tracing` natively. This was
helpful while debugging connectivity issue with the Kubernetes cluster.

The `bin/docker-build-policy-controller` helper script now *only* builds
the amd64 variant of the policy controller. It fails when asked to build
multiarch images.
2021-08-13 09:28:07 -07:00
Oliver Gould 75774b91f6
policy-controller: Update kube, k8s-openapi dependencies (#6661)
kube v0.59 depends on k8s-openapi v0.13, which includes breaking
changes.

This change updates these dependencies and modifies our code to account
for these changes.

Furthermore, we now use the k8s-openapi feature `v1_16` so that we use
an API version that is compatible with Linkerd's minimum support
kubernetes version.

Closes #6657 #6658 #6659
2021-08-13 00:50:39 -07:00
Oliver Gould 2558e7d8c0
policy-controller: Do not use caching (#6671)
crazy-max/ghaction-docker-buildx#172 describes a problem with
cross-building docker images--especially 32b ARM images--and docker
caching.

This change removes caching from the policy-controller dockerfile to
avoid this issue.
2021-08-12 14:36:06 -07:00
Oliver Gould b98c86700f
Import the linkerd-policy-controller (#6485)
We've implemented a new controller--in Rust!--that implements discovery
APIs for inbound server policies. This change imports this code from
linkerd/polixy@25af9b5e.

This policy controller watches nodes, pods, and the recently-introduced
`policy.linkerd.io` CRD resources. It indexes these resources and serves
a gRPC API that will be used by proxies to configure the inbound proxy
for policy enforcement.

This change introduces a new policy-controller container image and adds a
container to the `Linkerd-destination` pod along with a `linkerd-policy` service
to be used by proxies.

This change adds a `policyController` object to the Helm `values.yaml` that
supports configuring the policy controller at runtime.

Proxies are not currently configured to use the policy controller at runtime. This
will change in an upcoming proxy release.
2021-08-11 12:56:12 -07:00