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

Propagate trust bundles in the data plane contract #3605

Merged

Conversation

pierDipi
Copy link
Member

This is the follow up to #3594 for the control plane reconcilers.

  • Refactor prober's clients to use DialTLSContext to dynamically pass TLS config based on the current values of the trust bundles + CACerts field

Fixes #

Proposed Changes

  • Trust-manager integration
  • Allow administrators to add CA trust bundle to all Eventing Kafka components

Release Note

Add trust-manager integration, Knative Eventing Kafka components will add to the trusted Certificate Authorities (CAs) any PEM-encoded CA certificates in any `ConfigMap` in the `knative-eventing` namespace labeled with `networking.knative.dev/trust-bundle=true`

Docs

This is the follow up to knative-extensions#3594
for the control plane reconcilers.

- Refactor prober's clients to use `DialTLSContext` to dynamically pass
  TLS config based on the current values of the trust bundles + CACerts field

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/control-plane labels Jan 15, 2024
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 15, 2024
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 112 lines in your changes are missing coverage. Please review.

Comparison is base (951450e) 63.04% compared to head (fb24546) 62.70%.
Report is 12 commits behind head on main.

❗ Current head fb24546 differs from pull request most recent head 536c1d5. Consider uploading reports for the commit 536c1d5 to get more accurate results

Files Patch % Lines
control-plane/pkg/core/config/utils.go 0.00% 14 Missing ⚠️
...ane/pkg/reconciler/broker/namespaced_controller.go 0.00% 11 Missing ⚠️
control-plane/pkg/reconciler/channel/controller.go 44.44% 9 Missing and 1 partial ⚠️
...ol-plane/pkg/reconciler/channel/v2/controllerv2.go 23.07% 9 Missing and 1 partial ⚠️
control-plane/pkg/reconciler/sink/controller.go 23.07% 9 Missing and 1 partial ⚠️
control-plane/pkg/reconciler/broker/controller.go 47.05% 8 Missing and 1 partial ⚠️
control-plane/pkg/reconciler/consumer/consumer.go 35.71% 6 Missing and 3 partials ⚠️
...lane/pkg/reconciler/consumergroup/consumergroup.go 0.00% 7 Missing and 2 partials ⚠️
control-plane/pkg/reconciler/broker/broker.go 42.85% 6 Missing and 2 partials ⚠️
control-plane/pkg/reconciler/channel/channel.go 42.85% 6 Missing and 2 partials ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3605      +/-   ##
============================================
- Coverage     63.04%   62.70%   -0.34%     
- Complexity      843      844       +1     
============================================
  Files           183      183              
  Lines         12485    12512      +27     
  Branches        270      270              
============================================
- Hits           7871     7846      -25     
- Misses         4011     4056      +45     
- Partials        603      610       +7     
Flag Coverage Δ
java-unittests 76.66% <ø> (+0.03%) ⬆️

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.

@knative-prow knative-prow bot added area/test 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 Jan 15, 2024
@pierDipi
Copy link
Member Author

/retest-required

@pierDipi pierDipi force-pushed the trust-manager-control-plane branch 2 times, most recently from e35c4cb to 2c05029 Compare January 15, 2024 16:25
@pierDipi
Copy link
Member Author

/test unit-tests

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi
Copy link
Member Author

@Cali0707 I think I'm close to have fixed all the tests, can you give it a early review and I'll take a look tomorrow ?

@pierDipi
Copy link
Member Author

/test unit-tests

Copy link
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

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

Just a few questions, but it generally makes sense!

control-plane/pkg/core/config/utils.go Show resolved Hide resolved
test/rekt/features/kafka_source.go Show resolved Hide resolved
control-plane/pkg/core/config/utils.go Show resolved Hide resolved
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi pierDipi changed the title [WIP] Propagate trust bundles in the data plane contract Propagate trust bundles in the data plane contract Jan 17, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 17, 2024
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@Leo6Leo
Copy link
Contributor

Leo6Leo commented Jan 17, 2024

/retest-required

@pierDipi
Copy link
Member Author

/test reconciler-tests

1 similar comment
@pierDipi
Copy link
Member Author

/test reconciler-tests

@pierDipi
Copy link
Member Author

/cc @Cali0707

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi
Copy link
Member Author

/retest

1 similar comment
@creydr
Copy link
Contributor

creydr commented Jan 22, 2024

/retest

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Jan 22, 2024

/retest-required

Copy link
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold in case @creydr wants to take a look as well, feel free to unhold if you want to @pierDipi

@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 Jan 22, 2024
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2024
Copy link

knative-prow bot commented Jan 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, pierDipi

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

@creydr
Copy link
Contributor

creydr commented Jan 22, 2024

/retest

@creydr
Copy link
Contributor

creydr commented Jan 22, 2024

/unhold

@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 Jan 22, 2024
@knative-prow knative-prow bot merged commit 055dd02 into knative-extensions:main Jan 22, 2024
35 checks passed
@pierDipi pierDipi deleted the trust-manager-control-plane branch January 23, 2024 07:58
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Jan 26, 2024
…s#3605)

* Propagate trust bundles in the data plane contract

This is the follow up to knative-extensions#3594
for the control plane reconcilers.

- Refactor prober's clients to use `DialTLSContext` to dynamically pass
  TLS config based on the current values of the trust bundles + CACerts field

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add E2E tests

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add consumer group and consumer CA certs status propagation

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add comment to clarify PEM trust bundle validation

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Format code

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Set subscriberCACerts when scaled to 0

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add CA certs fields to KafkaChannel CRD

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Pass CA certs to contract for channel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-merge-bot bot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Jan 30, 2024
* Support adding trust bundles to data place HTTP clients (knative-extensions#3594)

This is the data plane only part related to the trust-manager
integration: knative/eventing#7532

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Propagate trust bundles in the data plane contract (knative-extensions#3605)

* Propagate trust bundles in the data plane contract

This is the follow up to knative-extensions#3594
for the control plane reconcilers.

- Refactor prober's clients to use `DialTLSContext` to dynamically pass
  TLS config based on the current values of the trust bundles + CACerts field

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add E2E tests

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add consumer group and consumer CA certs status propagation

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add comment to clarify PEM trust bundle validation

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Format code

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Set subscriberCACerts when scaled to 0

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add CA certs fields to KafkaChannel CRD

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Pass CA certs to contract for channel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Skip KafkaSource TLS tests on Istio (knative-extensions#3633)

* Skip KafkaSource TLS tests on Istio

* Run goimport

* Use midstream as eventing dependency

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Use new issuer

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add configuration for E2E tests

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Use Class instead of record

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
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/test lgtm Indicates that a PR is ready to be merged. 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.

None yet

4 participants