This is an automated email from the ASF dual-hosted git repository.

dimberman pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v1-10-test by this push:
     new 0e37b73  [AIRFLOW-5445] Reduce the required resources for the 
Kubernetes's sidecar (#6062)
0e37b73 is described below

commit 0e37b7332b804b049d069045becea4ca9d6caa57
Author: Kamil BreguĊ‚a <[email protected]>
AuthorDate: Sun Sep 15 23:15:53 2019 +0200

    [AIRFLOW-5445] Reduce the required resources for the Kubernetes's sidecar 
(#6062)
    
    
    (cherry picked from commit 7b5cf442e4a279403200118ebbafd41be0dd9389)
---
 airflow/kubernetes/pod_generator.py    | 7 ++++++-
 tests/kubernetes/test_pod_generator.py | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/airflow/kubernetes/pod_generator.py 
b/airflow/kubernetes/pod_generator.py
index 16a311f..3e1cb59 100644
--- a/airflow/kubernetes/pod_generator.py
+++ b/airflow/kubernetes/pod_generator.py
@@ -46,7 +46,12 @@ class PodDefaults:
         name=SIDECAR_CONTAINER_NAME,
         command=['sh', '-c', XCOM_CMD],
         image='alpine',
-        volume_mounts=[VOLUME_MOUNT]
+        volume_mounts=[VOLUME_MOUNT],
+        resources=k8s.V1ResourceRequirements(
+            requests={
+                "cpu": "1m",
+            }
+        ),
     )
 
 
diff --git a/tests/kubernetes/test_pod_generator.py 
b/tests/kubernetes/test_pod_generator.py
index bc6de96..4caf24b 100644
--- a/tests/kubernetes/test_pod_generator.py
+++ b/tests/kubernetes/test_pod_generator.py
@@ -185,7 +185,8 @@ class TestPodGenerator(unittest.TestCase):
                     'name': 'xcom',
                     'mountPath': '/airflow/xcom'
                 }
-            ]
+            ],
+            'resources': {'requests': {'cpu': '1m'}},
         }
         self.expected['spec']['containers'].append(container_two)
         self.expected['spec']['containers'][0]['volumeMounts'].insert(0, {

Reply via email to