-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add CiliumFlowLogging configuring Hubble-exporters #26646
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
baca4d4
to
5c46cc2
Compare
5c46cc2
to
4058917
Compare
4e83ff4
to
002f425
Compare
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
002f425
to
4ad7efc
Compare
/test |
// Spec defines the desired specification/configuration of the flow logging. | ||
// | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Spec is immutable" |
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.
cute :-)
|
||
// FlowLoggingSpec defines configuration of a flow logging task. | ||
// | ||
// +deepequal-gen=false |
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.
why not auto-generate DeepEqual?
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 is not needed (in this version it won't handle object updates at all). IIRC there were some issues when I left the default.
// | ||
// +kubebuilder:validation:Format=date-time | ||
// +kubebuilder:validation:Optional | ||
Expiration *metav1.Time `json:"end"` |
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.
nit: convention is "expires". Also, the json tag should probably match the field name.
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.
Also, I really like this idea. Are there any other limitations we might want to add? Maximum logged flows? Maxiumum rate? Sample rate?
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.
Rate is limited in the config map. Max logged flows is impossible to track across cilium-agent
pod restarts.
I am not sure how a sample rate could be implemented and I think it is best to use TCP flags to narrow down information to connection open/close.
@@ -0,0 +1,123 @@ | |||
// SPDX-License-Identifier: Apache-2.0 |
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.
In general, we avoid creating new watchers in this package, and prefer using the Resource[T] framework.
I realize this small comment is actually a fair bit of work :-(
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.
ok, I will look into that
@@ -637,6 +639,8 @@ func newDaemon(ctx context.Context, cleaner *daemonCleanup, params *daemonParams | |||
|
|||
d.cgroupManager = manager.NewCgroupManager() | |||
|
|||
d.hubbleExporterManager = exporter.NewManager(d.ctx) |
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 should probably be a Cell in the Hive. check out pkg/hive/examples
for the basic structure.
Signed-off-by: Aleksander Mistewicz <amistewicz@google.com>
@@ -219,7 +219,7 @@ GIT_VERSION: force | |||
-include Makefile.docker | |||
|
|||
##@ API targets | |||
CRD_OPTIONS ?= "crd:crdVersions=v1" | |||
CRD_OPTIONS ?= "crd:crdVersions=v1,ignoreUnexportedFields=true" |
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.
what are the implication of this option?
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.
See kubernetes-sigs/controller-tools#584 (it was cherry-picked into cilium's fork of controller-tools in cilium/controller-tools#3 and #26918)
It doesn't change other generated CRDs. It makes it possible to use types generated from protos directly without additional translation type.
// List of field names that will be kept in the log output. | ||
// | ||
// +kubebuilder:validation:Optional | ||
FieldMask []string `json:"fieldmask"` |
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.
typo: fieldMask
// disabled when empty. | ||
// | ||
// +kubebuilder:validation:Optional | ||
ExcludeFilters []*flowpb.FlowFilter `json:"exludefilters"` |
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.
typo: excludeFilters
This pull request has been automatically marked as stale because it |
This pull request has not seen any activity since it was marked stale. |
Fixes: #25508