-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[kube] Reduce apiserver request count for pod_service_mapper #476
Conversation
e6c6211
to
1e85a66
Compare
kubernetes/check.py
Outdated
@@ -32,6 +32,8 @@ | |||
DEFAULT_COLLECT_EVENTS = False | |||
DEFAULT_NAMESPACES = ['default'] | |||
|
|||
DEFAULT_SERVICE_EVENT_FREQ = 5 |
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 be in seconds. You can set it to 5 * 60
to be explicit.
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.
that's legit! pushing changes. As sister PR is merged, tests should pass now
kubernetes/check.py
Outdated
@@ -106,14 +108,17 @@ def __init__(self, name, init_config, agentConfig, instances=None): | |||
self._collect_events = _is_affirmative(inst.get('collect_events', DEFAULT_COLLECT_EVENTS)) | |||
if self._collect_events: | |||
self.event_retriever = self.kubeutil.get_event_retriever() | |||
elif self.kubeutil.collect_service_tag: | |||
# Only fetch service and pod events for service mapping | |||
event_delay = inst.get('service_tag_update_freq', DEFAULT_SERVICE_EVENT_FREQ) * 60 |
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.
and get rid of * 60
kubernetes/conf.yaml.example
Outdated
@@ -51,6 +51,13 @@ instances: | |||
# | |||
# collect_events: false | |||
# | |||
# Matching the pods to Kubernetes services requires to retrieve events regularly. | |||
# To reduce the traffic to the apiserver, we only query them every 5 minutes, adding a delay | |||
# in pod -> service matching. You can configure it below (in minutes) or disable kube_service |
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.
and of (in minutes)
1e85a66
to
e13a2ef
Compare
- add collect_service_tags option to disable collection - add service_tag_update_freq to reduce event requests
e13a2ef
to
c151abb
Compare
Sister PR for DataDog/dd-agent#3387, to reduce apiserver requests