<p>I was reading about Kubernetes events and it seems the only way to process events is to create a Watch over http call, which in turn processes the response and becomes Iterator of events. But that is finite and you have to recreate the event watch constantly... Is there a way to simply tail events with some callback, in Java?</p>

<p>As a native watching method for Kubernetes, you can watch events in real-time with <code>--watch</code>  <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes" rel="nofollow noreferrer">flag</a> - it is a part of API server, allowing to fetch the current state of resource/object and then subscribe to subsequent changes:</p>
<pre><code>kubectl get events --watch
</code></pre>
<p>There is no in-built solution in Kubernetes for storing/forward event objects on the long term as by default the events have a 1-hour life span. You would need to use third-party tools to stream the events continuously, e.g. -  <a href="https://github.com/caicloud/event_exporter?ref=thechiefio" rel="nofollow noreferrer">Kubernetes Event Exporter</a>; to collect them and export to external systems for alerting/further processing - e.g. <a href="https://github.com/bitnami-labs/kubewatch?ref=thechiefio" rel="nofollow noreferrer">kubewatch</a>, <a href="https://github.com/opsgenie/kubernetes-event-exporter" rel="nofollow noreferrer">kubernetes-event-exporter</a> tools.</p>
