Skip to content

KPO deferrable needs kubernetes_conn_id while non deferrable does not #30324

@iJanki-gr

Description

@iJanki-gr

Apache Airflow version

2.5.2

What happened

Not sure if this is a feature not a bug, but I can use KubernetesPodOperator fine without setting a kubernetes_conn_id.
For example:

start = KubernetesPodOperator(
        namespace="mynamespace",
        cluster_context="mycontext",
        security_context={ 'runAsUser': 1000 },
        name="hello",
        image="busybox",
        image_pull_secrets=[k8s.V1LocalObjectReference('prodregistry')],
        cmds=["sh", "-cx"],
        arguments=["echo Start"],
        task_id="Start",
        in_cluster=False,
        is_delete_operator_pod=True,
        config_file="/home/airflow/.kube/config",
    )

But if I add deferrable=True to this it won't work. It seems to require an explicit kubernetes_conn_id (which we don't configure).

Is not possible to the deferrable version to work as the non deferrable one?

What you think should happen instead

I hoped that kpo deferrable would work the same as non deferrable.

How to reproduce

Use KPO with deferrable=True but no kubernetes_conn_id setting

Operating System

Debian 11

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions