You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tries to resolve the #34717
For more details, upon of Node or Namespace event updates, we trigger updates for all pods that are related to the specific resources.
The issue is that many of those updates are not related with the actual metadata information that the watchers are made for. So we need to check which of those updates are the ones that should trigger pod watcher restarts
Download the elastic-agent-autodiscover repo linked in this story with relevant updates. In order to make filebeat to use the local copy of your elastic-agent-autodiscover library, update the /beats/go.mod file:
I left filebeat running for longer, and I could not see more updates on pods from the node healthcheck. But if I trigger it again by updating the labels of the node, I can see it the message again for pod update.
It seems to work fine!
gizas
added a commit
to elastic/elastic-agent-autodiscover
that referenced
this issue
Jan 12, 2024
- Enhancement
## Proposed commit message
- WHAT: Update the PodUpdater fucntion with additonal checks before
actaully triggering Pod watcher restarts
- WHY: There where node and namespace events that dont always inlcude
Metadata changes. We want only update events that change labels and
annotations of node and namespace to trigger pod updates. This leads to
bettwr management of watchers
## How to test this PR locally
See info elastic/beats#37338
## Related issues
- Relates elastic/beats#37338
- Relates elastic/beats#37431
---------
Co-authored-by: Tetiana Kravchenko <[email protected]>
Co-authored-by: Giuseppe Santoro <[email protected]>
Context
This issue tries to resolve the #34717
For more details, upon of Node or Namespace event updates, we trigger updates for all pods that are related to the specific resources.
The issue is that many of those updates are not related with the actual metadata information that the watchers are made for. So we need to check which of those updates are the ones that should trigger pod watcher restarts
Solution
We enhance the nodePodupdater function and we also pass the nodeWatcher as a parameter https://github.com/elastic/beats/blob/conditionsonPodupdater/libbeat/autodiscover/providers/kubernetes/pod.go#L156
Then we are able to check whether those updates are releavnt or not in order to trigger a pod update in https://github.com/elastic/elastic-agent-autodiscover/blob/conditionsonPodupdater/kubernetes/eventhandler.go#L236-L245
How to Test
kind create cluster
elastic-package stack up -d -vvv --version=8.12.0-SNAPSHOT
replace github.com/elastic/elastic-agent-autodiscover => /Users/andreasgkizas/elastic/elastic-agent-autodiscover
GOOS=linux GOARCH=arm64 go build
kubectl label nodes kind-control-plane katsoulis=pasole
Definition of Done
Testing
Metadata Event update in node triggers pod update
Healthcheck Event update in node does not trigger pod update
Relevant link:
Tasks
The text was updated successfully, but these errors were encountered: