-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Optimize identity allocation with CRD backend. #23064
Conversation
7e75539
to
59cd5d8
Compare
Travic CI - Pull Request - Build Errored:
and then succeeded. Gateway API Conformance Test failed with:
I don't think it is related to changes in the PR. |
Kicked travis; if it fails again, then something is wrong (obviously not caused by this PR). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a nice easy win, thanks!
A few nits, a few possible broader refactors, but I don't want to bikeshed :-)
372f769
to
e9ce046
Compare
I replied/fixed everything except for the indexing function. I'll try to determine whether it is safe to return error if the object is not a CiliumIdentity - it should be but I don't want to risk the store to panic |
/test Job 'Cilium-PR-K8s-1.24-kernel-5.4' failed: Click to show.Test Name
Failure Output
If it is a flake and a GitHub issue doesn't already exist to track it, comment |
I triggered tests just to be sure there are no regressions. |
Cilium Datapath (ci-datapath) — Datapath tests failed
|
All those curls terminated with exit code 28 which is time out. |
test failures should be fixed by #23171 |
I'll wait for it then and then rebase once it's merged. |
/test |
🚢 |
[ Backporter's notes: Ignoring changes from cilium#23064 ] pkg/allocator: Improve 'Key allocation attempt failed' handling for CRD mode In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
[ Backporter's notes: Ignoring changes from cilium#23064 ] pkg/allocator: Improve 'Key allocation attempt failed' handling for CRD mode In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
[ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] pkg/allocator: Improve 'Key allocation attempt failed' handling for CRD mode In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
[ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] pkg/allocator: Improve 'Key allocation attempt failed' handling for CRD mode In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
[ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] pkg/allocator: Improve 'Key allocation attempt failed' handling for CRD mode In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
[ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] pkg/allocator: Improve 'Key allocation attempt failed' handling for CRD mode In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
…RD mode [ upstream commit e39fcae ] [ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
…RD mode [ upstream commit e39fcae ] [ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
…RD mode [ upstream commit e39fcae ] [ Backporter's notes: Ignoring changes from cilium#23064, replaced maps.Clone() with Go 1.19 compatible code ] In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
…RD mode [ upstream commit e39fcae ] [ Backporter's notes: Ignoring changes from #23064, replaced maps.Clone() with Go 1.19 compatible code ] In CRD mode, the Cilium agent uses CRD to create identities. After an identity is created, the agent acquires a reference for that key. This involves fetching the CRD from the local Kubernetes cache and checking for an annotation applied by cilium-operator to mark the identity for deletion. However, there may be a delay before the Cilium Identity is cached locally, leading to the 'Key allocation attempt failed' error. This patch ensures that we fallback to the newly allocated Cilium Identity if it's not found in the Kubernetes cache. Signed-off-by: André Martins <andre@cilium.io> Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
[Backport, DROP on v1.14.0+] cilium#23064 Introduce by key indexer to prevent going through all the identities all the time. Removed the unit test since it's not compatible with v1.12. Fixes: cilium#22984 Change-Id: I7fb93276d5c899a4b49385f9bbee6a57148fd376 Signed-off-by: Alan Kutniewski <kutniewski@google.com> Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/654747 Reviewed-by: Dorde Lapcevic <dordel@google.com> Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/771428 Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com>
Introduce by key indexer to prevent going through all the identities all the time.
GlobalIdentity is moved to a separate packet so it can be imported without cyclic dependency.
Signed-off-by: Alan Kutniewski kutniewski@google.com
Fixes: #22984