c-thiel opened a new issue #19135:
URL: https://github.com/apache/airflow/issues/19135


   ### Description
   
   After the implementation of the Docker Taskflow Operator in 2.2, having a 
simple function on Kubernetes should be quite simple to accomplish.
   
   One major difference I see is how to get the Code into the Pod.
   My prefered way here would be to add an init container which takes care of 
this - much similar on how we use a Sidecar to extract XCom.
   
   I would also prefer to add more defaults than the KubernetesPodOperator does 
by default to keep the call as simple and straightforward as possible. We could 
for example default the namespace to the namespace Airflow is running in if it 
is a Kubernetes Deployment. Also, we could generate a reasonable pod name from 
DAG-ID and Task ID.
   
   ### Use case/motivation
   
   Beeing able to run a task as simple as:
   
   ```python
   @task.kubernetes(image='my_image:1.1.0')
   def sum(a, b):
       from my_package_in_version_1 import complex_sum
       return complex_sum(a,b)
   ```
   would be awesome!
   It would cleanly separate environments and resources between tasks just as 
the Docker or Virtualenv Operators do - and unlinke the `@task.python` 
decorator. We could specify the resources and environment of each task freely 
by specifying a `resources` Argument.
   
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to