Skip to content

cni: Only require ipam.Cidrs when masquerade is enabled#11978

Merged
aanm merged 1 commit intocilium:masterfrom
DataDog:ipam-cidr-no-masq
Jun 15, 2020
Merged

cni: Only require ipam.Cidrs when masquerade is enabled#11978
aanm merged 1 commit intocilium:masterfrom
DataDog:ipam-cidr-no-masq

Conversation

@bpineau
Copy link
Copy Markdown
Contributor

@bpineau bpineau commented Jun 9, 2020

Since recently, allocations results returned without CIDRs became fatal
for CNI (CNI cmdAdd() would fail due to interfaceAdd() failing, due to
RoutingInfo.parse() bailing out on len(cidrs) == 0).

That (now mandatory) IPv4CIDRs is used when masquerading is enabled,
to source-route traffic from the pods to its attached VPC CIDRs through
a dedicated local table (that I assume is exempt from masquerade).

But on Azure we don't collect and dont't propagate subnets CIDRs, and
that bit of information is missing from ciliumnodes azure crd/ipam.

Adding masquerade support to Azure CNI (therefore, collecting and bubbling
down per-address CIDRs) would be a nice feature to have in the longer term.
But we might be late in the feature freeze to implement that on time to
unbreak Azure CNI before 1.8 release; and there's no reason to insist on
having CIDRs when masquerade is disabled anyway.

Please ensure your pull request adheres to the following guidelines:

Don't require (not supported on Azure) ipam.Cidrs when masquerade is disabled

@bpineau bpineau requested review from a team June 9, 2020 09:53
@maintainer-s-little-helper
Copy link
Copy Markdown

Please set the appropriate release note label.

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 9, 2020

Coverage Status

Coverage increased (+0.01%) to 37.044% when pulling cddd622 on DataDog:ipam-cidr-no-masq into f6d62b5 on cilium:master.

Copy link
Copy Markdown
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

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

Changes look good, just a small comment.

If I understand you correctly, this is a temporary Azure fix until we support masquerading on Azure? If that's the case, happy to merge this in as a 1.8 backport.

Comment thread pkg/datapath/linux/routing/info_test.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add test cases for masquerade as it's now an extra variable?

Comment thread pkg/datapath/linux/routing/info.go Outdated
@christarazi christarazi added area/azure Impacts Azure based IPAM. area/cni Impacts the Container Networking Interface between Cilium and the orchestrator. kind/bug This is a bug in the Cilium logic. and removed dont-merge/needs-release-note labels Jun 9, 2020
@maintainer-s-little-helper
Copy link
Copy Markdown

Please set the appropriate release note label.

2 similar comments
@maintainer-s-little-helper
Copy link
Copy Markdown

Please set the appropriate release note label.

@maintainer-s-little-helper
Copy link
Copy Markdown

Please set the appropriate release note label.

@maintainer-s-little-helper
Copy link
Copy Markdown

Please set the appropriate release note label.

@christarazi christarazi added release-note/bug This PR fixes an issue in a previous release of Cilium. and removed dont-merge/needs-release-note labels Jun 9, 2020
@bpineau bpineau force-pushed the ipam-cidr-no-masq branch from 4e5d562 to f1f68a6 Compare June 10, 2020 07:40
@bpineau
Copy link
Copy Markdown
Contributor Author

bpineau commented Jun 10, 2020

@christarazi thanks for the review, PR updated.

You understood correctly. I don't know if anyone is actively working on masquerade support for Azure at the moment (I'd like to give a stab at it, but can't promise).

Yes it would be great to backport to 1.8, so Azure CNI would work when released (albeit not supporting all features AWS does).

Copy link
Copy Markdown
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for the PR!

@christarazi
Copy link
Copy Markdown
Member

test-me-please

Since recently, allocations results returned without CIDRs became fatal
for CNI (CNI cmdAdd() would fail due to interfaceAdd() failing, due to
RoutingInfo.parse() erroring out on `len(cidrs) == 0`).

That (now mandatory) `IPv4CIDRs` is used when masquerading is enabled,
to source-route traffic from the pods to its attached VPC CIDRs through
a dedicated local table (that I assume is exempt from masquerade).

But on Azure we don't collect and dont't propagate subnets CIDRs, and
that bit of information is missing from ciliumnodes azure crd/ipam.

Adding masquerade support to Azure CNI (therefore, collecting and bubbling
down per-address CIDRs) would be a nice feature to have in the longer term.
But we might be late in the feature freeze to implement that on time to
unbreak Azure CNI before 1.8 release; and there's no reason to insist on
having CIDRs when masquerade is disabled anyway.

Signed-off-by: Benjamin Pineau <benjamin.pineau@datadoghq.com>
@bpineau bpineau force-pushed the ipam-cidr-no-masq branch from f1f68a6 to cddd622 Compare June 11, 2020 10:06
@aanm
Copy link
Copy Markdown
Member

aanm commented Jun 11, 2020

test-me-please

@christarazi christarazi added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 12, 2020
@aanm aanm merged commit f3b474a into cilium:master Jun 15, 2020
@maintainer-s-little-helper maintainer-s-little-helper Bot removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/azure Impacts Azure based IPAM. area/cni Impacts the Container Networking Interface between Cilium and the orchestrator. kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants