datapath: Accept proxy traffic if enable-endpoint-routes are enabled#11819
Merged
datapath: Accept proxy traffic if enable-endpoint-routes are enabled#11819
Conversation
Contributor
Author
|
test-me-please |
Contributor
Author
|
test-gke K8sServicesTest* EDIT: GKE tests passed |
aanm
approved these changes
Jun 2, 2020
aanm
approved these changes
Jun 2, 2020
43168d1 to
86a2832
Compare
Member
|
test-gke K8sServicesTest* |
Member
|
test-me-please |
Member
|
Testing this locally, still needed to manually add the last two rules to make nodeport pass. After: It looks like the new rules were not added, i.e., Logging the traffic that hits the added rule: Note the |
The forward chain rules have been depended on the local delivery interface which depending on the setting of enable-endpoint-routes is either `cilium_host` or `lxc+`. This is sufficient for all regular traffic. For proxy redirection traffic, all traffic still passes through cilium_host regardless of the value of enable-endpoint-routes. Eample of existing rules: ``` -A CILIUM_FORWARD -o lxc+ -m comment --comment "cilium: any->cluster on lxc+ forward accept" -j ACCEPT -A CILIUM_FORWARD -i lxc+ -m comment --comment "cilium: cluster->any on lxc+ forward accept (nodeport)" -j ACCEPT -A CILIUM_FORWARD -i lxc+ -m comment --comment "cilium: cluster->any on lxc+ forward accept" -j ACCEPT ``` This problem was masked because Kubernetes would install these wide-reaching rules: ``` -A KUBE-FORWARD -m comment --comment "kubernetes forwarding conntrack pod source rule" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A KUBE-FORWARD -m comment --comment "kubernetes forwarding conntrack pod destination rule" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT ``` However, more recent versions of Kubernetes would install more fine-grained rules when the PodCIDR is known too the host: ``` -A KUBE-FORWARD -s 10.10.0.0/16 -m comment --comment "kubernetes forwarding conntrack pod source rule" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT ``` This will still mask the problem if Cilium uses the PodCIDR for IP allocation. However, in case Cilium does not use the announced PodCIDR then these rules would no longer allow the proxy redirection traffic causes proxy redirection to break. Fixes: #11235 Fixes: #11807 Signed-off-by: Jarno Rajahalme <jarno@covalent.io> Signed-off-by: Thomas Graf <thomas@cilium.io>
86a2832 to
3f787af
Compare
…n GKE Signed-off-by: Thomas Graf <thomas@cilium.io> Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
3f787af to
0fe4db3
Compare
Member
|
test-me-please |
Member
|
test-gke K8sServicesTest* |
Member
|
netnext hit by #11741 |
Member
|
retest-net-next |
Member
|
GKE tests failed to start at all: Logs indicate that cilium-agent did not became ready, which would cause the DNS not to become ready either. Quick look on the cilium-agent logs did not reveal why it is not ready, though. |
Contributor
|
@jrajahalme it could be because of #11801 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The forward chain rules have been depended on the local delivery
interface which depending on the setting of enable-endpoint-routes is
either
cilium_hostorlxc+. This is sufficient for all regulartraffic. For proxy redirection traffic, all traffic still passes through
cilium_host regardless of the value of enable-endpoint-routes.
Eample of existing rules:
This problem was masked because Kubernetes would install these
wide-reaching rules:
However, more recent versions of Kubernetes would install more
fine-grained rules when the PodCIDR is known too the host:
This will still mask the problem if Cilium uses the PodCIDR for IP
allocation. However, in case Cilium does not use the announced PodCIDR
then these rules would no longer allow the proxy redirection traffic
causes proxy redirection to break.
Fixes: #11235
Fixes: #11807