[
https://issues.apache.org/jira/browse/AIRFLOW-3819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16762548#comment-16762548
]
ASF GitHub Bot commented on AIRFLOW-3819:
-----------------------------------------
atrbgithub commented on pull request #4660: [AIRFLOW-3819] - Allow the
configuration of a global default for work…
URL: https://github.com/apache/airflow/pull/4660
…imits and requests
Make sure you have checked _all_ steps below.
### Jira
- [x] My PR addresses the following [Airflow
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
- https://issues.apache.org/jira/browse/AIRFLOW-3819
### Description
Currently the kubernetes executor allows you to specify pod resources
requests and limits (cpu and memory). For example:
```
# Limit resources on this operator/task with node affinity & tolerations
three_task = PythonOperator(
task_id="three_task", python_callable=print_stuff, dag=dag,
executor_config={
"KubernetesExecutor": {"request_memory": "128Mi",
"limit_memory": "128Mi",
"tolerations": tolerations,
"affinity": affinity}}
)
```
These values are used by kubernetes when making scaling decisions. This PR
allows you to specify a global default for these values, to ensure that each
pod airflow creates has a value specified for these properties.
You are still able to modify these values on a dag by dag basis.
### Tests
There are currently no tests around configuring resources limits/request
values as used in the example above, and these would be non-trivial to add due
to the integration with kube_client.
### Commits
- [x] My commits all reference Jira issues in their subject lines, and I
have squashed multiple commits if they address the same issue. In addition, my
commits follow the guidelines from "[How to write a good git commit
message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Documentation
- [x] In case of new functionality, my PR adds documentation that describes
how to use it.
`default_airflow.cfg` has been updated with the new settings with a
descriptive comment and a link to the Kubernetes documentation.
### Code Quality
- [x] Passes `flake8`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> k8s executor - Allow the configuration of a global default for pod resource
> request/limits
> -------------------------------------------------------------------------------------------
>
> Key: AIRFLOW-3819
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3819
> Project: Apache Airflow
> Issue Type: Improvement
> Components: kubernetes
> Affects Versions: 1.10.2
> Reporter: afusr
> Priority: Minor
>
> Currently the kubernetes executor allows you to specify pod resources
> requests and limits (cpu and memory). For example:
> {noformat}
> # Limit resources on this operator/task with node affinity & tolerations
> three_task = PythonOperator(
> task_id="three_task", python_callable=print_stuff, dag=dag,
> executor_config={
> "KubernetesExecutor": {"request_memory": "128Mi",
> "limit_memory": "128Mi",
> "tolerations": tolerations,
> "affinity": affinity}}
> )
> {noformat}
> These values are used by kubernetes when making scaling decisions. It would
> be nice to be able to specify a global default for these values, to ensure
> that each pod airflow creates has a value specified for these properties.
> There is still the requirement to override these values on a dag by dag
> basis.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)