Skip to content

SparkKubernetesOperator with deferrable=True falls through to KubernetesPodOperator.execute() creating a spurious pod #66437

@nikhilkarve

Description

@nikhilkarve

Under which category would you file this issue?

Providers

Apache Airflow version

3.0.6

What happened and how to reproduce it?

When using SparkKubernetesOperator with deferrable=True, the operator creates the SparkApplication CR successfully, but then attempts to create a second, empty Kubernetes Pod (with no container image) via the inherited KubernetesPodOperator code path. This results in a 422 Unprocessable Entity error:
"Pod \"...-driver\" is invalid: spec.containers[0].image: Required value"

How to reproduce:

  1. Create a SparkKubernetesOperator task with deferrable=True.
  2. Provide the container image via the SparkApplication YAML (not via the operator's image parameter)
  3. Run the task — the SparkApplication is created, but a second empty pod creation attempt fails with 422

What you think should happen instead?

Pod should go in deferrable state.

Operating System

No response

Deployment

None

Apache Airflow Provider(s)

cncf-kubernetes

Versions of Apache Airflow Providers

apache-airflow-providers-cncf-kubernetes: 10.16.1

Official Helm Chart version

Not Applicable

Kubernetes Version

No response

Helm Chart configuration

No response

Docker Image customizations

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions