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

fix(server): use pod-name:pod-ip as node identity for kubearmor daemon #62

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

rksharma95
Copy link
Contributor

to avoid the case, if kubearmor pod recreated for any reason and pod deletion event received after pod added event then node will be removed from current list of nodes/kubearmor-pods if node id is created using node-ip only.

{"level":"warn","ts":"2024-11-21 13:42:55.674541","caller":"log/logger.go:79","msg":"failed to receive an alert (192.168.29.159:32767) rpc error: code = Unavailable desc = error reading from server: EOF"}
{"level":"info","ts":"2024-11-21 13:42:55.674623","caller":"log/logger.go:54","msg":"Destroyed the client (192.168.29.159:32767)"}
{"level":"warn","ts":"2024-11-21 13:42:55.674978","caller":"log/logger.go:84","msg":"Failed to call WatchMessages (192.168.29.159:32767) err=rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 192.168.29.159:32767: connect: connection refused\"\n"}
{"level":"info","ts":"2024-11-21 13:42:55.874444","caller":"log/logger.go:54","msg":"[addevent] pod kubearmor-bpf-containerd-98c2c-4krn9 has been added"}
{"level":"info","ts":"2024-11-21 13:42:56.273261","caller":"log/logger.go:54","msg":"[deleteEvent] pod kubearmor-bpf-containerd-98c2c-s9bnk has been deleted"}
{"level":"info","ts":"2024-11-21 13:42:56.273329","caller":"log/logger.go:54","msg":"pod with nodeip 192.168.29.159 deleted"}

to avoid the case, if kubearmor pod recreated for any reason and
pod deletion event received after pod added event then node will be
removed from current list of nodes/kubearmor-pods if node id is created
using node ip only.

Signed-off-by: rksharma95 <[email protected]>
@rksharma95
Copy link
Contributor Author

/review @anurag-rajawat

Copy link
Member

@rootxrishabh rootxrishabh left a comment

Choose a reason for hiding this comment

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

The fix looks good. Nice work 👍

Copy link
Member

@DelusionalOptimist DelusionalOptimist left a comment

Choose a reason for hiding this comment

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

LGTM.

@DelusionalOptimist DelusionalOptimist merged commit 2119f72 into kubearmor:main Nov 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants