Class KubernetesEventPublisher
- All Implemented Interfaces:
EventListener, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationListener<MessageEvent<?>>
MessageEvents that signal a configuration or application startup problem as
Kubernetes core/v1 Warning Events on the pod, when Frank!Framework runs inside a
Kubernetes cluster. This surfaces problems such as a configuration failing to start
("aborted starting") to cluster-level tooling (kubectl get events, dashboards,
operators) without log scraping, and catches non-crashing warnings that a crash-based signal would
miss.
Only ConfigurationMessageEvent and ApplicationMessageEvents at
MessageEventLevel.WARN or MessageEventLevel.ERROR are published. Kubernetes Events
only have the types Normal and Warning, so both map to Warning; the severity
is carried in the Event reason.
It reuses the same in-cluster Kubernetes access as AbstractKubernetesCredentialProvider
(the fabric8 client). At startup it builds a client and probes the API; if there is no in-cluster
access (local runs, plain servlet containers) it is a silent no-op. Set
management.kubernetes.events.enabled=false to disable it entirely.
RBAC: the pod's ServiceAccount needs create on the core events resource in
its own namespace — a different grant than reading secrets. Without it the API returns 403, which is
caught and logged, leaving startup unaffected.
-
Constructor Summary
ConstructorsConstructorDescriptionKubernetesEventPublisher(org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voidonApplicationEvent(@NonNull MessageEvent<?> event) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
KubernetesEventPublisher
@Autowired public KubernetesEventPublisher(org.springframework.core.env.Environment environment)
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<MessageEvent<?>>
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-