Skip to content

Send namespace header in MT components#3184

Merged
knative-prow[bot] merged 1 commit intoknative-extensions:mainfrom
pierDipi:add-kn-namespace-header
Jun 29, 2023
Merged

Send namespace header in MT components#3184
knative-prow[bot] merged 1 commit intoknative-extensions:mainfrom
pierDipi:add-kn-namespace-header

Conversation

@pierDipi
Copy link
Copy Markdown
Member

When running MT components [1] in mesh mode with Istio,
we lose the ability to define fine grained policies since we
don't know the resource namespace that originated such
request, therefore, by having a Kn-Namespace header,
in mesh mode, users case define fine-grained policies and
isolate namespaces.

[1] KafkaSource, Kafka Broker, and KafkaChannel

Related to knative/eventing#7048

When running MT components [1] in mesh mode with Istio,
we lose the ability to define fine grained policies since we
don't know the resource namespace that originated such
request, therefore, by having a `Kn-Namespace` header,
in mesh mode, users case define fine-grained policies and
isolate namespaces.

[1] KafkaSource, Kafka Broker, and KafkaChannel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@knative-prow knative-prow Bot requested review from aliok and odacremolbap June 29, 2023 07:24
@knative-prow knative-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/data-plane labels Jun 29, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 29, 2023

Codecov Report

Merging #3184 (24a87a4) into main (3c98b7c) will decrease coverage by 16.64%.
The diff coverage is 100.00%.

@@              Coverage Diff              @@
##               main    #3184       +/-   ##
=============================================
- Coverage     80.14%   63.51%   -16.64%     
  Complexity      757      757               
=============================================
  Files            77      167       +90     
  Lines          2670    11661     +8991     
  Branches        239      239               
=============================================
+ Hits           2140     7407     +5267     
- Misses          388     3701     +3313     
- Partials        142      553      +411     
Flag Coverage Δ
java-unittests 80.15% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...ispatcher/impl/http/WebClientCloudEventSender.java 82.50% <100.00%> (+0.14%) ⬆️

... and 90 files with indirect coverage changes

@pierDipi
Copy link
Copy Markdown
Member Author

/assign @matzew @mgencur

@pierDipi
Copy link
Copy Markdown
Member Author

/test channel-integration-tests-ssl

.timeout(this.consumerVerticleContext.getEgressConfig().getTimeout() <= 0 ? DEFAULT_TIMEOUT_MS : this.consumerVerticleContext.getEgressConfig().getTimeout())
.putHeader("Prefer", "reply"))
.putHeader("Prefer", "reply")
.putHeader("Kn-Namespace", this.consumerVerticleContext.getEgress().getReference().getNamespace())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so we set it all the time.

but benefit from it on the "mesh case", since we can use that for filtering/tweaking ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes

@pierDipi pierDipi requested a review from matzew June 29, 2023 11:02
Copy link
Copy Markdown
Contributor

@matzew matzew left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2023
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Jun 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Details 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 merged commit fe4652b into knative-extensions:main Jun 29, 2023
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this pull request Jul 20, 2023
When running MT components [1] in mesh mode with Istio,
we lose the ability to define fine grained policies since we
don't know the resource namespace that originated such
request, therefore, by having a `Kn-Namespace` header,
in mesh mode, users case define fine-grained policies and
isolate namespaces.

[1] KafkaSource, Kafka Broker, and KafkaChannel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-merge-robot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Jul 20, 2023
When running MT components [1] in mesh mode with Istio,
we lose the ability to define fine grained policies since we
don't know the resource namespace that originated such
request, therefore, by having a `Kn-Namespace` header,
in mesh mode, users case define fine-grained policies and
isolate namespaces.

[1] KafkaSource, Kafka Broker, and KafkaChannel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/eventing-kafka-broker that referenced this pull request Jul 20, 2023
When running MT components [1] in mesh mode with Istio,
we lose the ability to define fine grained policies since we
don't know the resource namespace that originated such
request, therefore, by having a `Kn-Namespace` header,
in mesh mode, users case define fine-grained policies and
isolate namespaces.

[1] KafkaSource, Kafka Broker, and KafkaChannel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-merge-robot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Jul 21, 2023
When running MT components [1] in mesh mode with Istio,
we lose the ability to define fine grained policies since we
don't know the resource namespace that originated such
request, therefore, by having a `Kn-Namespace` header,
in mesh mode, users case define fine-grained policies and
isolate namespaces.

[1] KafkaSource, Kafka Broker, and KafkaChannel

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@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/data-plane lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants