Skip to content

Knative support #903

Closed
Closed

Description

@Niksko

Describe the feature

Knative currently supports weighted routing, but doesn't have any of the features of Flagger around automating the rollout of new versions. However it feels like the primitives are there. This issues has been discussed in the past (#92), but I wondered if it was time to bring it up again, with both Flagger and Knative having matured since then.

The slightly incongruous portion of this integration would be the fact that Knative has native support for 'versions'. However this seems like it means that Flagger has less to do, since the logic to maintain multiple versions of an application is handled for us in Knative.

Proposed solution

Allow for Flagger to watch Knative primitives for updates, and to create and update objects that implement a routing change accordingly.

Any alternatives you've considered?

Writing a custom controller just for Knative wouldn't be that hard. However the custom controller would likely re-implement much of the functionality and logic of Flagger, around coordinating canaries, A/B tests, rollback, metric monitoring etc. Likewise with implementing this functionality in Knative itself.

Activity

  1. edude03 commented on Nov 29, 2021

    @edude03

    Just chiming in, I'd also like this or something similar

  2. salaboy commented on Jul 15, 2022

    @salaboy

    I am also interested in moving this forward.. I wonder what the limitations are right now, is the only blocker related to watching Knative resources to trigger flagger features?

    @edude03 @Niksko
    I wonder if @dprotaso has tried this out at some point. Because I think that having some of this integration will be a great PoC.

  3. aryan9600 commented on Jul 17, 2022

    @aryan9600
    Member

    I would say one of the major blockers is that Knative does not support header based traffic routing (ref: knative/serving#4736), which would mean Flagger won't be able to support the A/B deployment strategy for Knative.
    Progressive delivery does seem possible to implement in theory, as Flagger would just need to modify the Knative Service .spec.traffic.weights of the revisions to drive the canary analysis forward

  4. cgrotz commented on Jul 17, 2022

    @cgrotz
    Contributor

    I think the Knative (and for that Cloud Run) approach for a/b testing would be to use tags. https://knative.dev/development/serving/traffic-management/

  5. dprotaso commented on Jul 22, 2022

    @dprotaso

    👋 Hi I'm the Serving lead on the Knative project

    @cgrotz is correct you can use tags when manipulating the traffic block and that'll give you a unique URL per revision.

    @aryan9600 if you have further questions let me know - I'm in the knative/cncf slack with the same handle as my GitHub (@dprotaso)

  6. evankanderson commented on Aug 4, 2022

    @evankanderson

    With tag-based header routing, you should be able to use tags along with Knative's built-in weighted traffic distribution without needing to directly interface with Istio, Contour, etc.

    Alternatively, you could use Knative tags for the backend and create your own front-end Istio, Linkerd, etc and rewrite the Host header so that you're steering traffic to specific revisions, which might be more appropriate for the canary-selection logic (for example).

  7. ZhiminXiang commented on Aug 26, 2022

    @ZhiminXiang

    A useful feature of Flagger is metric-based rollout/rollback https://docs.flagger.app/usage/metrics. While currently in Knative, the gradual rollout is time based https://knative.dev/docs/serving/rolling-out-latest-revision/#procedure

    It would be great that the metric-based rollout/rollback feature of Flagger could support Knative.

  8. aryan9600 commented on Aug 26, 2022

    @aryan9600
    Member

    Hey folks, support for Knative is on the roadmap: https://github.com/fluxcd/flagger#integrations. We're planning to start work on this soon, but are pre-occupied by a few other higher priority items. Thanks :)

  9. evankanderson commented on Aug 30, 2022

    @evankanderson
  10. evankanderson commented on Mar 1, 2023

    @evankanderson

    (FYI, we added Prometheus monitoring annotations for the net-kourier plugin in the 1.9 release: knative-extensions/net-kourier#978)

    This means that all of: Istio, Contour and Kourier should export HTTP metrics by default which can be used to control rollouts via Flagger.

  11. jpfaria commented on Mar 7, 2024

    @jpfaria

    Any news on this topic? It would be very important to have knative support.

  12. salaboy commented on Mar 7, 2024

    @salaboy

    @jpfaria I think we need to upvote this to gain relevance

  13. stefanprodan commented on Mar 23, 2025

    @stefanprodan
    Member

    Implemented in #1682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions