Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep other controller statuses when updating httproute status #11705

Merged
merged 4 commits into from
Dec 11, 2023

Conversation

adleong
Copy link
Member

@adleong adleong commented Dec 6, 2023

Fixes #11659

When the policy controller updates the status of an HttpRoute, it will override any existing statuses on that resource.

We update the policy controller to take into account any statuses which are not controlled by Linkerd already on the resource. It will patch the final statuses to be the combination of thee non-Linkerd statuses plus the Linkerd statuses.

Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong requested a review from a team as a code owner December 6, 2023 05:58
Signed-off-by: Alex Leong <alex@buoyant.io>
Copy link
Member

@mateiidavid mateiidavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -6,6 +6,7 @@ use crate::{
use ahash::{AHashMap as HashMap, AHashSet as HashSet};
use chrono::offset::Utc;
use chrono::DateTime;
use gateway::RouteParentStatus;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this needs to be included i'd prefer to i'd prefer to include this on line 12 like:

use linkerd_policy_controller_k8s_api::{self as k8s, gateway::{self, RouteParentStatus}, ResourceExt};

having indirect/relative imports like this gets very confusing in my experience.

Comment on lines 293 to 301
let unowned_statuses = route
.statuses
.iter()
.filter_map(|parent_ref| self.parent_status(parent_ref, backend_condition.clone()))
.collect();
.filter(|status| status.controller_name != POLICY_CONTROLLER_NAME)
.cloned();
let parent_statuses = route
.parents
.iter()
.filter_map(|parent_ref| self.parent_status(parent_ref, backend_condition.clone()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand this by adding a comment that explains why this is load bearing?

Is this essentially that we are "replacing" any statuses where the controller name is ours? I think the implicit bit here is that parent_status only returns the status of things for which we control status?

@alpeb
Copy link
Member

alpeb commented Dec 7, 2023

Unrelated to the current fix, but I noticed we are not conserving previous conditions. Looking at statuses in other resources like Pods, it seems we should?

Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong merged commit fee1c68 into main Dec 11, 2023
35 checks passed
@adleong adleong deleted the alex/route-status branch December 11, 2023 19:32
alpeb added a commit that referenced this pull request Dec 14, 2023
## edge-23.12.2

This edge release includes a restructuring of the proxy's balancer along with
accompanying new metrics. The new minimum supported Kubernetes version is 1.22.

* Restructured the proxy's balancer ([#11750]): balancer changes may now occur
  independently of request processing. Fail-fast circuit breaking is enforced on
  the balancer's queue so that requests can't get stuck in a queue indefinitely.
  This new balancer is instrumented with new metrics: request (in-queue) latency
  histograms, failfast states, discovery updates counts, and balancer endpoint
  pool sizes.
* Changed how the policy controller updates HTTPRoute status so that it doesn't
  affect statuses from other non-linkerd controllers ([#11705]; fixes [#11659])

[#11750]: #11750
[#11705]: #11705
[#11659]: #11659
alpeb added a commit that referenced this pull request Dec 14, 2023
## edge-23.12.2

This edge release includes a restructuring of the proxy's balancer along with
accompanying new metrics. The new minimum supported Kubernetes version is 1.22.

* Restructured the proxy's balancer ([#11750]): balancer changes may now occur
  independently of request processing. Fail-fast circuit breaking is enforced on
  the balancer's queue so that requests can't get stuck in a queue indefinitely.
  This new balancer is instrumented with new metrics: request (in-queue) latency
  histograms, failfast states, discovery updates counts, and balancer endpoint
  pool sizes.
* Changed how the policy controller updates HTTPRoute status so that it doesn't
  affect statuses from other non-linkerd controllers ([#11705]; fixes [#11659])

[#11750]: #11750
[#11705]: #11705
[#11659]: #11659
adleong added a commit that referenced this pull request Dec 20, 2023
Fixes #11659

When the policy controller updates the status of an HttpRoute, it will override any existing statuses on that resource.  

We update the policy controller to take into account any statuses which are not controlled by Linkerd already on the resource.  It will patch the final statuses to be the combination of thee non-Linkerd statuses plus the Linkerd statuses.

Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong mentioned this pull request Dec 20, 2023
adleong added a commit that referenced this pull request Dec 20, 2023
This stable release fixes two bugs in the Linkerd control plane.

* Fixed an issue in the destination controller where the metadata API was not
  properly initialized for jobs, leading to error messages and unnecessary API
  calls ([#11541])
* Fixed an issue in the policy controller where it was overriding statuses on
  HTTPRoute resources from other controllers ([#11705])

[#11541]: #11541
[#11705]: #11705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linkerd is altering status on HTTPRoutes it doesn't own
4 participants