<p>I'm using the following Airflow version inside my Docker container and I am currently having some issues related to a broken DAG</p>
<pre><code>FROM apache/airflow:2.3.4-python3.9
</code></pre>
<p>I have other DAGs running with the same argument 'request_cpu' and perfectly functional, I'm not sure what the issue could be</p>
<pre><code>Broken DAG: [/home/airflow/airflow/dags/my_project.py] Traceback (most recent call last):
  File &quot;/home/airflow/.local/lib/python3.10/site-packages/airflow/models/baseoperator.py&quot;, line 858, in __init__
    self.resources = coerce_resources(resources)
  File &quot;/home/airflow/.local/lib/python3.10/site-packages/airflow/models/baseoperator.py&quot;, line 133, in coerce_resources
    return Resources(**resources)
TypeError: Resources.__init__() got an unexpected keyword argument 'request_cpu'
</code></pre>
<p>This is my current DAG configuration</p>
<pre><code># DAG configuration
DAG_ID = &quot;my_project_id&quot;
DAG_DESCRIPTION = &quot;description&quot;
DAG_IMAGE = image

default_args = {
    &quot;owner&quot;: &quot;airflow&quot;,
    &quot;depends_on_past&quot;: False,
    &quot;max_active_tasks&quot;: 1,
    &quot;max_active_runs&quot;: 1,
    &quot;email_on_failure&quot;: True,
    &quot;email&quot;: [&quot;my@mail.com&quot;],
    &quot;retries&quot;: 0,
    &quot;email_on_retry&quot;: False,
    &quot;image_pull_policy&quot;: &quot;Always&quot;,
}

# Define desired resources.
compute_resources = {
    # Cpu: 500m milliCPU is about half cpu, other values, 1, 2, 4... for full cpu allocation
    &quot;request_cpu&quot;: &quot;500m&quot;,
    # Memory: Mi for Megabytes or Gi for Gigabytes
    &quot;request_memory&quot;: &quot;512Mi&quot;,
    &quot;limit_cpu&quot;: &quot;500m&quot;,
    &quot;limit_memory&quot;: &quot;1Gi&quot;,
}


with DAG(
    DAG_ID,
    default_args=default_args,
    start_date=datetime(2022, 5, 9),
    schedule_interval=&quot;0 21 */16 * *&quot;,  # Every 16 days or twice per month
    max_active_runs=1,
    max_active_tasks=1,
    catchup=False,
    description=DAG_DESCRIPTION,
    tags=[&quot;my tags&quot;],
) as dag:
    # AWS credentials
    creds = tools.get_config_params(key=&quot;AWS-keys&quot;)

    my_task = KubernetesPodOperator(
        namespace=&quot;airflow&quot;,
        image=DAG_IMAGE,
        image_pull_secrets=[k8s.V1LocalObjectReference(&quot;docker-registry&quot;)],
        container_resources=compute_resources,
        env_vars={
            &quot;AWS_ACCESS_KEY_ID&quot;: creds[&quot;access_key&quot;],
            &quot;AWS_SECRET_ACCESS_KEY&quot;: creds[&quot;secret_access_key&quot;],
            &quot;EXECUTION_DATE&quot;: &quot;{{ execution_date }}&quot;,
        },
        cmds=[&quot;python3&quot;, &quot;my_project.py&quot;],
        is_delete_operator_pod=True,
        in_cluster=False,
        name=&quot;my-project-name&quot;,
        task_id=&quot;my-task&quot;,
        config_file=os.path.expanduser(&quot;~&quot;) + &quot;/.kube/config&quot;,
        get_logs=True,
        resources=compute_resources,
    )
</code></pre>

The Dan
<p>First <code>resources</code> is <a href="https://github.com/apache/airflow/blob/6b75be43171eafc45825d043ef051638aa103ccd/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py#L222-L223" rel="noreferrer">deprecated</a> so you should use only <code>container_resources</code>.</p>
<p>The <code>container_resources</code> is expecting <code>V1ResourceRequirements</code> not <code>dict</code>. You should do:</p>
<pre><code>from kubernetes.client import models as k8s

compute_resources=k8s.V1ResourceRequirements(
    requests={
        'memory': '512Mi',
        'cpu': '500m'
    },
    limits={
        'memory': '1Gi',
        'cpu': 500m
    }
)
</code></pre>
<p>Then</p>
<pre><code> my_task = KubernetesPodOperator(..., container_resources=compute_resources)
</code></pre>
