Skip to content
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

pkg/policy: index policies by k8s UID #28173

Merged
merged 1 commit into from Sep 15, 2023

Conversation

aanm
Copy link
Member

@aanm aanm commented Sep 15, 2023

As k8s UID are unique, we can index the policies by their UId. This will decrease Cilium's boot-up time for clusters with a large number of network policies.

For a cluster with a lot of network policies that was taking ~4m20s to boot Cilium, with this change it will take ~20 seconds.

Cut Cilium's initialization time for clusters with a large number of Kubernetes and Cilium Network Policies by 90%

As k8s UID are unique, we can index the policies by their UId. This will
decrease Cilium's boot-up time for clusters with a large number of
network policies.

For a cluster with a lot of network policies that was taking ~4m20s to
boot Cilium, with this change it will take ~20 seconds.

Signed-off-by: André Martins <andre@cilium.io>
@aanm aanm added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. affects/v1.12 This issue affects v1.12 branch affects/v1.13 This issue affects v1.13 branch affects/v1.14 This issue affects v1.14 branch labels Sep 15, 2023
@aanm aanm requested a review from a team as a code owner September 15, 2023 14:35
@aanm aanm added the sig/policy Impacts whether traffic is allowed or denied based on user-defined policies. label Sep 15, 2023
@aanm
Copy link
Member Author

aanm commented Sep 15, 2023

/test

@christarazi christarazi added the kind/performance There is a performance impact of this. label Sep 15, 2023
Copy link
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.

Nice!

Copy link
Member

@nathanjsweet nathanjsweet left a comment

Choose a reason for hiding this comment

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

I like it!

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 15, 2023
@christarazi christarazi merged commit 4cb0940 into cilium:main Sep 15, 2023
61 of 62 checks passed
@christarazi christarazi added the kind/enhancement This would improve or streamline existing functionality. label Sep 15, 2023
@aanm aanm deleted the pr/indexer-per-rule branch September 18, 2023 14:36
@aanm aanm added the needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch label Sep 18, 2023
@giorio94 giorio94 mentioned this pull request Sep 26, 2023
22 tasks
@giorio94 giorio94 added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Sep 26, 2023
@aanm aanm added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. labels Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/v1.12 This issue affects v1.12 branch affects/v1.13 This issue affects v1.13 branch affects/v1.14 This issue affects v1.14 branch backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. kind/enhancement This would improve or streamline existing functionality. kind/performance There is a performance impact of this. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants