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

feat: channels use consumergroups #3816

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

Cali0707
Copy link
Member

@Cali0707 Cali0707 commented Apr 4, 2024

Fixes #3047

As part of the KEDA Kafka component scaling, we need to move channels to use consumergroups internally. This makes that change.

Proposed Changes

  • Use the channelv2 reconciler implementation
  • Use statefulsets instead of deployments for the channel

Release Note

Channels now use consumergroups internally. IMPORTANT: to downgrade from this release, you will need to delete any consumergroups owned by a channel, and delete the kafka-channel-receiver and kafka-channel-dispatcher statefulsets

Docs

Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow bot requested review from aliok and pierDipi April 4, 2024 20:09
@knative-prow knative-prow bot added area/control-plane area/data-plane size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 4, 2024
Copy link

knative-prow bot commented Apr 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 4, 2024
Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

Cali0707 commented Apr 4, 2024

@pierDipi I'm planning on removing the channel v1 implementation in a follow up PR, so that it's easier to see any changes I make in this PR (rather than having a complicated diff)

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 72.38806% with 74 lines in your changes are missing coverage. Please review.

Project coverage is 48.45%. Comparing base (aacc057) to head (b4f283e).
Report is 18 commits behind head on main.

Files Patch % Lines
control-plane/pkg/reconciler/channel/channel.go 73.47% 46 Missing and 15 partials ⚠️
...md/post-install/kafka_broker_deployment_deleter.go 0.00% 7 Missing ⚠️
control-plane/pkg/reconciler/channel/controller.go 88.00% 2 Missing and 1 partial ⚠️
control-plane/cmd/post-install/main.go 0.00% 2 Missing ⚠️
control-plane/cmd/kafka-controller/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #3816       +/-   ##
=============================================
- Coverage     73.70%   48.45%   -25.25%     
=============================================
  Files           100      246      +146     
  Lines          3419    14474    +11055     
  Branches        292        0      -292     
=============================================
+ Hits           2520     7014     +4494     
- Misses          723     6755     +6032     
- Partials        176      705      +529     
Flag Coverage Δ
java-unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cali0707
Copy link
Member Author

Cali0707 commented Apr 4, 2024

Looks like everything is broken 😅
/hold

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 4, 2024
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

/cc @creydr @pierDipi

I made some changes around OIDC/TrustBundles for channelv2, where I am a lot less familiar with the code. Would you mind taking a look at the changes and seeing if they make sense?

@knative-prow knative-prow bot requested a review from creydr April 12, 2024 18:27
@Cali0707
Copy link
Member Author

/unhold

I think things should work now (the failing tests passed when I ran them locally, I think they are flaky in CI)

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 12, 2024
Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

Cali0707 commented May 3, 2024

/retest-required

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2024
Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2024
@knative-prow knative-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 7, 2024
@Cali0707
Copy link
Member Author

Cali0707 commented May 7, 2024

/cc @creydr

Would you mind taking another look now that the merge conflicts are fixed?

Signed-off-by: Calum Murray <cmurray@redhat.com>
@creydr
Copy link
Contributor

creydr commented May 7, 2024

@Cali0707 thanks for updating. Can you check on @pierDipi comments? (e.g. #3816 (review))

Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

Cali0707 commented May 7, 2024

/cc @creydr @pierDipi

Thanks for the reminder about the earlier comments @creydr!

Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

Cali0707 commented May 7, 2024

/retest-required

1 similar comment
@Cali0707
Copy link
Member Author

Cali0707 commented May 7, 2024

/retest-required

@Cali0707
Copy link
Member Author

@pierDipi @creydr could you take another look at this PR? Seems like everything is passing 🎉


func (k *kafkaDeploymentDeleter) DeleteChannelDeployments(ctx context.Context) error {
deployments := []string{
"kafka-channel-receiver",
Copy link
Member

Choose a reason for hiding this comment

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

same as the other one, received should be kept to Deployment

@@ -46,4 +46,4 @@ data:
renewDeadline: "10s"
retryPeriod: "2s"
map-lease-prefix.kafka-broker-controller.knative.dev.eventing-kafka-broker.control-plane.pkg.reconciler.source.Reconciler: kafka-controller.knative.dev.eventing-kafka.pkg.source.reconciler.source.reconciler
map-lease-prefix.kafka-broker-controller.knative.dev.eventing-kafka-broker.control-plane.pkg.reconciler.channel.Reconciler: kafkachannel-controller.knative.dev.eventing-kafka.pkg.channel.consolidated.reconciler.controller.reconciler
map-lease-prefix.kafka-broker-controller.knative.dev.eventing-kafka-broker.control-plane.pkg.reconciler.channel.v2.Reconciler: kafkachannel-controller.knative.dev.eventing-kafka.pkg.channel.consolidated.reconciler.controller.reconciler
Copy link
Member

Choose a reason for hiding this comment

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

if we move to the top-level pkg and remove the old one, I think we don't need this update

Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 14, 2024
@Cali0707
Copy link
Member Author

/cc @pierDipi

Thanks for all the reviews so far!

@knative-prow knative-prow bot requested a review from pierDipi May 14, 2024 16:04
@Cali0707
Copy link
Member Author

     wait.go:200: test-yhaulcep/containersource-ndhkncsn condition is {"type":"Ready","status":"False","lastTransitionTime":"2024-05-14T16:28:18Z","reason":"TrustBundlePropagation","message":"failed to create ConfigMap test-yhaulcep/knative-eventing-bundlekne-bundle: configmaps \"knative-eventing-bundlekne-bundle\" already exists"} 

Looks like trust bundle issues on the container source

/retest-required

@Cali0707
Copy link
Member Author

/test integration-tests

Copy link

knative-prow bot commented May 16, 2024

@Cali0707: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
reconciler-tests_eventing-kafka-broker_main b4f283e link true /test reconciler-tests

Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane area/data-plane area/test do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-scaling Kafka Consumers for KafkaChannel's Subscriptions
4 participants