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

[kube] Reduce apiserver request count for pod_service_mapper #476

Merged
merged 1 commit into from Jun 15, 2017

Conversation

xvello
Copy link
Contributor

@xvello xvello commented Jun 14, 2017

Sister PR for DataDog/dd-agent#3387, to reduce apiserver requests

@@ -32,6 +32,8 @@
DEFAULT_COLLECT_EVENTS = False
DEFAULT_NAMESPACES = ['default']

DEFAULT_SERVICE_EVENT_FREQ = 5
Copy link
Member

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.

Copy link
Contributor Author

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

@@ -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
Copy link
Member

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

@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

and of (in minutes)

@xvello xvello force-pushed the xvello/kubeservicemapper_delay branch from 1e85a66 to e13a2ef Compare June 15, 2017 11:34
- add collect_service_tags option to disable collection
- add service_tag_update_freq to reduce event requests
@xvello xvello force-pushed the xvello/kubeservicemapper_delay branch from e13a2ef to c151abb Compare June 15, 2017 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants