Class KubernetesEventPublisher

java.lang.Object
org.frankframework.kubernetes.KubernetesEventPublisher
All Implemented Interfaces:
EventListener, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationListener<MessageEvent<?>>

@IbisInitializer public class KubernetesEventPublisher extends Object implements org.springframework.context.ApplicationListener<MessageEvent<?>>, org.springframework.beans.factory.DisposableBean
Publishes 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 Details

    • KubernetesEventPublisher

      @Autowired public KubernetesEventPublisher(org.springframework.core.env.Environment environment)
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(@NonNull MessageEvent<?> event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<MessageEvent<?>>
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean