You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/05/10 11:46:34 UTC

[GitHub] [airflow] talnagar commented on pull request #23531: make resources for KubernetesPodTemplate templated

talnagar commented on PR #23531:
URL: https://github.com/apache/airflow/pull/23531#issuecomment-1122283560

   I tried locally with kind-cluster and the templating didn't take. @nitinmuteja can you supply a usage example for it?
   this is what I tried using the example_kubernetes_executor.py from the example_dags in the repo:
   ```
   ....
     with DAG(
           dag_id='example_kubernetes_executor',
           schedule_interval=None,
           start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
           catchup=False,
           tags=['example3'],
           params={
               'mem': Param(default='512Mi',type='string', description="memory"),
           }
   ....
    # Use k8s_client.V1ResourceRequirements to define resource limits
           k8s_resource_requirements = k8s.V1ResourceRequirements(
               requests={'memory': "{{ params['mem'] }}"}, limits={'memory': '512Mi'}
           )
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org