-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add policy listener support #21600
Merged
pchaigno
merged 11 commits into
cilium:master
from
jrajahalme:add-policy-listener-support
Dec 13, 2022
Merged
Add policy listener support #21600
pchaigno
merged 11 commits into
cilium:master
from
jrajahalme:add-policy-listener-support
Dec 13, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jrajahalme
added
area/proxy
Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers.
sig/policy
Impacts whether traffic is allowed or denied based on user-defined policies.
area/servicemesh
GH issues or PRs regarding servicemesh
labels
Oct 6, 2022
maintainer-s-little-helper
bot
added
the
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
label
Oct 6, 2022
jrajahalme
force-pushed
the
add-policy-listener-support
branch
from
October 6, 2022 11:57
a23db6e
to
a670ecf
Compare
jrajahalme
force-pushed
the
add-policy-listener-support
branch
from
October 7, 2022 12:08
a670ecf
to
b15c5a2
Compare
jrajahalme
force-pushed
the
add-policy-listener-support
branch
from
October 7, 2022 12:31
b15c5a2
to
294dd1c
Compare
jrajahalme
force-pushed
the
add-policy-listener-support
branch
from
October 10, 2022 10:46
294dd1c
to
2a11ccd
Compare
Add a new no-op CRDRedirect type to be used with Envoy listeners defined in CEC CRDs. In this case the listeners already exist and new Envoy Listener resources do not need to be created for them. This is needed for the forthcoming policy feature where policy can refer to a Listener defined in CEC CRD. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Find CRD proxy port by name instead of type. This is needed for enabling CEC CRD defined listeners to be used in CNPs. Prior to this CRD proxy ports did not use this code path, which is only called from endpoint policy updates, so there was no need to find CRD proxy ports by name. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Move resourceQualifiedName() to policy/api and export it so that it can be used in policy as well as in envoy package. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Add `listener` field to CNP and CCNP, that causes traffic to the specified port(s) to be redirected to the named Envoy listener. If the listener does not exist the traffic is not allowed at all. When `listener.envoyConfig.kind` is left out it defaults to namespaced `CiliumEnvoyConfig` for rules in namespaced policies (CNP) or to cluster-scoped `CiliumClusterwideEnvoyConfig` for rules in cluster-scoped policies (CCNP). Namespaced policies can also refer to cluster-scoped listeners with an explicit `listener.envoyConfig.kind: CiliumClusterwideEnvoyConfig`. Cluster-scoped policies can not refer to namespaced listeners. Endpoint policies are regenerated whenever Envoy listeners change to update potential listener redirections in the bpf policy maps. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
jrajahalme
force-pushed
the
add-policy-listener-support
branch
from
December 13, 2022 10:43
36825ec
to
55d477d
Compare
@christarazi Addressed your comments and rebased :-) |
/test |
christarazi
approved these changes
Dec 13, 2022
CLI review is not needed as it is affected only via |
jrajahalme
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Dec 13, 2022
joestringer
added
backport-pending/1.13
The backport for Cilium 1.13.x for this PR is in progress.
and removed
needs-backport/1.13
This PR / issue needs backporting to the v1.13 branch
labels
Dec 21, 2022
maintainer-s-little-helper
bot
moved this from Needs backport from master
to Backport pending to v1.13
in 1.13.0-rc4
Dec 21, 2022
maintainer-s-little-helper
bot
moved this from Needs backport from master
to Backport pending to v1.13
in 1.13.0-rc4
Dec 21, 2022
maintainer-s-little-helper
bot
removed
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
labels
Dec 21, 2022
joestringer
added
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
and removed
backport-pending/1.13
The backport for Cilium 1.13.x for this PR is in progress.
labels
Dec 22, 2022
joestringer
moved this from Backport pending to v1.13
to Backport done to v1.10
in 1.13.0-rc4
Dec 22, 2022
nbusseneau
pushed a commit
to nbusseneau/cilium
that referenced
this pull request
Jun 22, 2023
[ upstream commit 525007f ] [ backporter's notes: conflicts in proxy_test.go around the new test case, I decided not to include the test case because it depends on changes introduced in cilium#21600, which was not backported to v1.12. If the test case is important enough, we should remove this from the current round of backport and do another round with the dependent PR included. ] CreateOrUpdateRedirect called nil revertFunc when any local error was returned. This was done using the pattern `return 0, err, nil, nil` which sets the revertFunc return variable as nil, but this was called on a deferred function to revert any changes on a local error. Fix this by calling ReverStack.Revert() directly on the deferred function, and setting the return variable if there was no local error. This was hit any time a CiliumNetworkPolicy referred to a non-existing listener. Add a test case that reproduced the panic and works after the fix. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com> Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
borkmann
pushed a commit
that referenced
this pull request
Jun 29, 2023
[ upstream commit 525007f ] [ backporter's notes: conflicts in proxy_test.go around the new test case, I decided not to include the test case because it depends on changes introduced in #21600, which was not backported to v1.12. If the test case is important enough, we should remove this from the current round of backport and do another round with the dependent PR included. ] CreateOrUpdateRedirect called nil revertFunc when any local error was returned. This was done using the pattern `return 0, err, nil, nil` which sets the revertFunc return variable as nil, but this was called on a deferred function to revert any changes on a local error. Fix this by calling ReverStack.Revert() directly on the deferred function, and setting the return variable if there was no local error. This was hit any time a CiliumNetworkPolicy referred to a non-existing listener. Add a test case that reproduced the panic and works after the fix. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com> Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/proxy
Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers.
area/servicemesh
GH issues or PRs regarding servicemesh
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
release-blocker/1.13
This issue will prevent the release of the next version of Cilium.
release-note/minor
This PR changes functionality that users may find relevant to operating Cilium.
sig/policy
Impacts whether traffic is allowed or denied based on user-defined policies.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for
listener
keyword in CNP to redirect matching traffic to an Envoy listener.Please review commit-by-commit.