Skip to content

cfp: Adding the options to get the DNS rules#2

Merged
hemanthmalla merged 2 commits intohemanthmalla:tofqdn_hafrom
vipul-21:singhvipul/dnsrules
Jul 17, 2024
Merged

cfp: Adding the options to get the DNS rules#2
hemanthmalla merged 2 commits intohemanthmalla:tofqdn_hafrom
vipul-21:singhvipul/dnsrules

Conversation

@vipul-21
Copy link
Copy Markdown

@vipul-21 vipul-21 commented May 9, 2024

No description provided.

@vipul-21 vipul-21 force-pushed the singhvipul/dnsrules branch 12 times, most recently from 7d2de42 to 3a908e2 Compare May 16, 2024 03:29
@vipul-21 vipul-21 force-pushed the singhvipul/dnsrules branch from 3a908e2 to 0911110 Compare May 22, 2024 00:36
@vipul-21 vipul-21 force-pushed the singhvipul/dnsrules branch 3 times, most recently from 6b74a85 to 71013e2 Compare May 31, 2024 16:47
Method : UpdatesDNSRules

_rpc UpdatesDNSRules(stream DNSPolicyRules) returns (Result){}_
_rpc UpdatesDNSRules(Request) returns (stream DNSPolicyRules){}_
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Are we sure the flip is necessary here ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It seems more intuitive to me as DNSPolicyRules are being returned to the SDP.

Copy link
Copy Markdown
Owner

@hemanthmalla hemanthmalla Jul 8, 2024

Choose a reason for hiding this comment

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

UpdatesDNSRules is intended to be invoked from agent when there is a policy update, so cannot flip the order right ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, UpdateDNSRules is intended to invoked from agent. How would the agent know about invoking the SDP ? So in this case, SDP has the responsibility to tell the cilium agent that I need the rules, instead of Cilium agent trying to find to whom it should send the rules.(if that make sense)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

We introduced tracking policy revisions per SDP instance to deal with this. On a connection, agent always sends policy information, on ACK, we track it against the connection, every policy update resulting in a revision bump we notify all SDP instances. On agent restart, we start over.

![standalone-dns-proxy-down-scenario](./images/standalone-dns-proxy-down-scenario.png)


#### Option 2: Running the GRPC server in the SDP as well
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If option 1 is possible, do we really need option 2 ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We tested this option too as well.
I added it keeping in mind that SDP may/may not handle policy in the future. So we might need to consider a grpc server in the SDP.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

SDP not handling policy would be violate the toFQDN spec right ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, I am not sure if I understand this. What do you mean by violating the toFQDN spec ?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I meant to say that SDP not enforcing L7 DNS policy is not an option right ?


##### Cons

* Will change the current implmentation/flow of flitering the dns requests.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What changes wrt DNS requests ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I mean right now we filter based on the identities associated with the dns ip right ? If are writing to the file system similar to what is written currently i.e dns pod ip, the check would be to filter based on the ip rather than identities.
It depends on what we store in the file.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Alright, after today's sync, we can consider updating this section to include relevant details from ep_policy.json

* Will change the current implmentation/flow of flitering the dns requests.
* Reading a file might not be as efficient as reading from a gRPC server.

### Q : Why did we choose grpc option over reading from filesystem?
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If we understand the rationale / find a workaround for lazy update of DNS rules, ep_config.json might still be preferred ? We should probably leave this open ended and remove option 1 as recommended ?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

cilium/cilium#33412 changes the preference here ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think it depends on the performance of the both the options. Reading from the filesystem make sense to me in case of starting the SDP, but should that be default path to get the rules not sure.
The overhead to read/file watch on every endpoint maybe too much in high scale environment. I think if we can segregate just the dns rules to a different file that might be a bit better though.

@vipul-21 vipul-21 force-pushed the singhvipul/dnsrules branch 2 times, most recently from bfd15f0 to a6545fd Compare July 9, 2024 16:50
@vipul-21 vipul-21 requested a review from hemanthmalla July 9, 2024 16:50
@vipul-21 vipul-21 force-pushed the singhvipul/dnsrules branch from c4ccb8e to 74f2a75 Compare July 11, 2024 00:53

## Impacts / Key Questions

### Getting the DNS Rules
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think this section is now decently flushed out. I'm thinking we can move it from Impacts / Key Questions to the main proposal. We now have an agreement that this is how SDP should discover rules right.

Copy link
Copy Markdown
Owner

@hemanthmalla hemanthmalla left a comment

Choose a reason for hiding this comment

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

LGTM except for couple of nits. Will address them outside this PR

@hemanthmalla hemanthmalla merged commit 616ae89 into hemanthmalla:tofqdn_ha Jul 17, 2024
vipul-21 added a commit to vipul-21/design-cfps that referenced this pull request Aug 9, 2024
* cfp: Adding the options to get the DNS rules

* Addressing comments

Signed-off-by: Vipul Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants