Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement event creation after terminating a pod #105

Merged
merged 2 commits into from
Sep 17, 2018

Conversation

djboris9
Copy link
Contributor

Currently chaoskube logs the termination of pods only to stdout. This patch implements the creation of a Kubernetes Event in victims namespace so users which cannot access chaoskubes logs can see who terminated their pod. There is a new flag to disable this feature.

Event looks like:

$ kubectl get events
LAST SEEN   FIRST SEEN   COUNT     NAME                                       KIND        SUBOBJECT                      TYPE      REASON         SOURCE                            MESSAGE
56s         56s          1         calico-node-tj5pq.chaos.15543f44b237b716   Pod                                        Normal    Chaos                                            Deleted pod calico-node-tj5pq

RBAC rules were extended to allow this function.

@linki linki merged commit 9cc0fa1 into linki:master Sep 17, 2018
@linki
Copy link
Owner

linki commented Sep 17, 2018

Thanks @djboris9 🎉

suite.Require().Len(events.Items, 1)
event := events.Items[0]

suite.Equal("foo.chaos.-2be96689beac4e00", event.Name)
Copy link
Owner

Choose a reason for hiding this comment

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

For anyone who cares: the third part of the event name is the timestamp of ThankGodItsFriday{}.Now() (Fri, 24 Sep 1869 15:04:05 UTC, roughly a hundred years before timestamp 0) in nanoseconds and encoded in base64... 🤷‍♂️

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants