-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Introduce dynamic hubble flow logs exporters based on config file #28873
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
Conversation
890c558
to
43f3aa0
Compare
I'll take a deeper look a bit later this week but so far the general approach looks good. One thought: can get some metrics? A few useful metrics:
|
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.
@marqc Nice work! Cool feature.
43f3aa0
to
1c1e15f
Compare
1c1e15f
to
970218b
Compare
970218b
to
d0d532e
Compare
58cbaac
to
40ceaec
Compare
Done. As flowlog already has a "name" identifying it I use it instead of calculating hash in metrics. |
40ceaec
to
d4f57ff
Compare
/test |
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.
It looks like I'm late to the review party, sorry about that.
That's a great contribution Marek! The implementation looks pretty solid overall, I only have a few comments (see below).
6f2b41c
to
e510e02
Compare
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.
Great work 🚀 ! Let's get this in before the v1.15 cut.
e510e02
to
d33a197
Compare
/test |
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.
Overall good job. Thanks!
install/kubernetes/cilium/templates/cilium-flowlog-configmap.yaml
Outdated
Show resolved
Hide resolved
d33a197
to
2ff9189
Compare
/test |
2ff9189
to
e20dea7
Compare
Signed-off-by: Marek Chodor <mchodor@google.com>
e20dea7
to
6aa8733
Compare
/test |
/ci-ipsec-upgrade |
For some reason, travis didn't run. Travis is only running arm64 unit tests so it's safe to assume that this PR can be merged. Thank you for the contribution. |
Add protoc-gen-gotag plugin to builder image. Add yaml annotations to flow proto gen files. Introduce dynamic hubble flow logs exporters based on config file. Signed-off-by: Marek Chodor <mchodor@google.com> Carry-Patch-Approval: b/309936968 Upstream-PR: cilium#28873 Upstream-PR: cilium#28943 Upstream-PR: cilium#28944 Change-Id: I7871d8b119822c3228a6e959b86dd1b6b23d275a Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/860928 Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-by: Akhil Velagapudi <avelagap@google.com> Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Tested-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com>
Carry-Patch-Approval: b/309936968 Upstream-PR: cilium#28873 Change-Id: Ie0028dfba1ad9f6185ddb996582a934eb11b5452 Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/866204 Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Tested-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Prow-Auto-Submit: Marek Chodor <mchodor@google.com> Reviewed-by: Alan Kutniewski <kutniewski@google.com> Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com>
The new parser utilizes json tags to keep API consistent. This also reverts cherry-pick of cilium#28944 as this is no longer needed. Carry-Patch-Approval: b/309936968 Upstream-PR: cilium#28873 Change-Id: I8d44e7f937fb56f3c5c6c4ed943586d39a4ea17b Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/867331 Tested-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-by: Akhil Velagapudi <avelagap@google.com> Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Prow-Auto-Submit: Marek Chodor <mchodor@google.com>
Carry-Patch-Approval: b/309936968 Upstream-PR: cilium#28873 Change-Id: Ib38ed5f1581900ab06da92cb2f3931b0cadad152 Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/867864 Prow-Auto-Submit: Marek Chodor <mchodor@google.com> Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-by: Akhil Velagapudi <avelagap@google.com> Tested-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com>
Carry-Patch-Approval: b/309936968 Upstream-PR: cilium#28873 Change-Id: Id7a619b9fb19ae6ee4f1ecc2549ac7dec5c64019 Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/873423 Reviewed-by: Dorde Lapcevic <dordel@google.com> Prow-Auto-Submit: Marek Chodor <mchodor@google.com> Tested-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com>
Upstream-PR: cilium#28873 Signed-off-by: Marek Chodor <mchodor@google.com> Change-Id: Ib2b6937ba276d7fee127b856c02212053d9bb3ee Reviewed-on: https://gke-internal-review.googlesource.com/c/third_party/cilium/+/899008 Unit-Verified: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-by: Akhil Velagapudi <avelagap@google.com> Reviewed-by: Aleksander Mistewicz <amistewicz@google.com> Tested-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com> Reviewed-by: Prow_Bot_V2 <425329972751-compute@developer.gserviceaccount.com>
description and a
Fixes: #XXX
line if the commit addresses a particularGitHub issue.
Introduce dynamic hubble flowlog exporters configuration guided by config file.
Changes in the config file are reflected without a need to restart cilium-agent, so it allows to dynamically specify flowlog requests. Each request contains the output file path, field mask, include filters (to allow flows), exclude filters (to deny flows) and end time at which flowlog will automatically stop collecting flows. The low-level implementation reuses a current hubble exporter. The config file will be populated from configmap (but allows customization if needed).
The config file is in YAML format, sample config file.
This is a follow up from discussion in #28220 cc: @chancez @AwesomePatrol @nathanperkins
Fixes: #25508
TODO list:
replace periodic file reads with inotifyAs this PR is already quite big I will do it in a separate PR