Repository navigation
Description
Description
#75013 adds log_events_on_startup to KubernetesPodOperator and KubernetesPodTrigger so users on large clusters can switch off the startup event watcher, which makes the API server read every event in the namespace on each poll.
The GKE and EKS operators inherit the synchronous path, so the parameter works there in sync mode. In deferrable mode it is lost:
GKEStartPodOperator.invoke_defer_method(providers/google/src/airflow/providers/google/cloud/operators/kubernetes_engine.py) buildsGKEStartPodTriggerwith an explicit kwarg list that does not include the flag, andGKEStartPodTrigger.serialize()re-lists its fields without it.EksPodOperator.invoke_defer_method(providers/amazon/src/airflow/providers/amazon/aws/operators/eks.py) buildsEksPodTriggerthe same way, andEksPodTrigger.__init__has a fixed signature with no**kwargs.
KubernetesPodTrigger.serialize() therefore emits the key only when the flag is False, so neither subclass breaks, but GKEStartPodOperator(deferrable=True, log_events_on_startup=False) and the EKS equivalent still watch events in the triggerer. The provider docs (providers/cncf/kubernetes/docs/operators.rst, "Pod events in the task log") state this limitation.
Work needed
- Forward
log_events_on_startupfrom both operators to their triggers. - Accept and serialize it in
EksPodTriggerand include it inGKEStartPodTrigger.serialize()(only whenFalse, matching the base trigger). - Raise the
apache-airflow-providers-cncf-kubernetesminimum version in the google and amazon providers to the release that ships the parameter; the trigger__init__of older cncf versions rejects the kwarg. - Remove the limitation sentence from the cncf docs.
Acceptance criteria
GKEStartPodOperator(deferrable=True, log_events_on_startup=False)andEksPodOperator(deferrable=True, log_events_on_startup=False)create no event watch in the triggerer (unit test on each trigger's_wait_for_pod_start).- Default serialization of both triggers stays unchanged.
Related
- KubernetesPodOperator startup event polling overloads kube-apiserver at scale and fails tasks on 504 #75013
- Make KubernetesPodOperator event logging best-effort and optional #75016 (the cncf change that introduces the parameter)
Drafted-by: Claude Code (Fable 5.1) (no human review before posting)
Activity
ameymhadgut commentedon Oct 21, 2026
Hi, I'd like to pick this up. I'll forward log_events_on_startup through EksPodOperator/GKEStartPodOperator defer paths into their triggers (init + serialize), with unit tests for both providers.
shahar1 commentedon Oct 22, 2026
Feel free to raise a PR