apache-airflow-providers-cncf-kubernetes 5.3.0rc1__py3-none-any.whl → 6.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airflow/providers/cncf/kubernetes/get_provider_info.py +2 -0
- airflow/providers/cncf/kubernetes/hooks/kubernetes.py +11 -0
- airflow/providers/cncf/kubernetes/operators/pod.py +4 -2
- airflow/providers/cncf/kubernetes/utils/pod_manager.py +2 -16
- airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py +10 -2
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/METADATA +23 -5
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/RECORD +12 -12
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/LICENSE +0 -0
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/NOTICE +0 -0
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/entry_points.txt +0 -0
- {apache_airflow_providers_cncf_kubernetes-5.3.0rc1.dist-info → apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info}/top_level.txt +0 -0
|
@@ -27,7 +27,9 @@ def get_provider_info():
|
|
|
27
27
|
"package-name": "apache-airflow-providers-cncf-kubernetes",
|
|
28
28
|
"name": "Kubernetes",
|
|
29
29
|
"description": "`Kubernetes <https://kubernetes.io/>`__\n",
|
|
30
|
+
"suspended": False,
|
|
30
31
|
"versions": [
|
|
32
|
+
"6.0.0",
|
|
31
33
|
"5.3.0",
|
|
32
34
|
"5.2.2",
|
|
33
35
|
"5.2.1",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
import contextlib
|
|
20
|
+
import json
|
|
20
21
|
import tempfile
|
|
21
22
|
import warnings
|
|
22
23
|
from typing import TYPE_CHECKING, Any, Generator
|
|
@@ -101,6 +102,9 @@ class KubernetesHook(BaseHook):
|
|
|
101
102
|
"xcom_sidecar_container_image": StringField(
|
|
102
103
|
lazy_gettext("XCom sidecar image"), widget=BS3TextFieldWidget()
|
|
103
104
|
),
|
|
105
|
+
"xcom_sidecar_container_resources": StringField(
|
|
106
|
+
lazy_gettext("XCom sidecar resources (JSON format)"), widget=BS3TextFieldWidget()
|
|
107
|
+
),
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
@staticmethod
|
|
@@ -366,6 +370,13 @@ class KubernetesHook(BaseHook):
|
|
|
366
370
|
"""Returns the xcom sidecar image that defined in the connection"""
|
|
367
371
|
return self._get_field("xcom_sidecar_container_image")
|
|
368
372
|
|
|
373
|
+
def get_xcom_sidecar_container_resources(self):
|
|
374
|
+
"""Returns the xcom sidecar resources that defined in the connection"""
|
|
375
|
+
field = self._get_field("xcom_sidecar_container_resources")
|
|
376
|
+
if not field:
|
|
377
|
+
return None
|
|
378
|
+
return json.loads(field)
|
|
379
|
+
|
|
369
380
|
def get_pod_log_stream(
|
|
370
381
|
self,
|
|
371
382
|
pod_name: str,
|
|
@@ -245,7 +245,7 @@ class KubernetesPodOperator(BaseOperator):
|
|
|
245
245
|
def __init__(
|
|
246
246
|
self,
|
|
247
247
|
*,
|
|
248
|
-
kubernetes_conn_id: str | None =
|
|
248
|
+
kubernetes_conn_id: str | None = KubernetesHook.default_conn_name,
|
|
249
249
|
namespace: str | None = None,
|
|
250
250
|
image: str | None = None,
|
|
251
251
|
name: str | None = None,
|
|
@@ -810,7 +810,9 @@ class KubernetesPodOperator(BaseOperator):
|
|
|
810
810
|
if self.do_xcom_push:
|
|
811
811
|
self.log.debug("Adding xcom sidecar to task %s", self.task_id)
|
|
812
812
|
pod = xcom_sidecar.add_xcom_sidecar(
|
|
813
|
-
pod,
|
|
813
|
+
pod,
|
|
814
|
+
sidecar_container_image=self.hook.get_xcom_sidecar_container_image(),
|
|
815
|
+
sidecar_container_resources=self.hook.get_xcom_sidecar_container_resources(),
|
|
814
816
|
)
|
|
815
817
|
|
|
816
818
|
labels = self._get_ti_pod_labels(context)
|
|
@@ -39,7 +39,6 @@ from urllib3.exceptions import HTTPError as BaseHTTPError
|
|
|
39
39
|
from urllib3.response import HTTPResponse
|
|
40
40
|
|
|
41
41
|
from airflow.exceptions import AirflowException
|
|
42
|
-
from airflow.kubernetes.kube_client import get_kube_client
|
|
43
42
|
from airflow.kubernetes.pod_generator import PodDefaults
|
|
44
43
|
from airflow.utils.log.logging_mixin import LoggingMixin
|
|
45
44
|
from airflow.utils.timezone import utcnow
|
|
@@ -219,28 +218,15 @@ class PodManager(LoggingMixin):
|
|
|
219
218
|
|
|
220
219
|
def __init__(
|
|
221
220
|
self,
|
|
222
|
-
kube_client: client.CoreV1Api
|
|
223
|
-
in_cluster: bool = True,
|
|
224
|
-
cluster_context: str | None = None,
|
|
221
|
+
kube_client: client.CoreV1Api,
|
|
225
222
|
):
|
|
226
223
|
"""
|
|
227
224
|
Creates the launcher.
|
|
228
225
|
|
|
229
226
|
:param kube_client: kubernetes client
|
|
230
|
-
:param in_cluster: whether we are in cluster
|
|
231
|
-
:param cluster_context: context of the cluster
|
|
232
227
|
"""
|
|
233
228
|
super().__init__()
|
|
234
|
-
|
|
235
|
-
self._client = kube_client
|
|
236
|
-
else:
|
|
237
|
-
self._client = get_kube_client(in_cluster=in_cluster, cluster_context=cluster_context)
|
|
238
|
-
warnings.warn(
|
|
239
|
-
"`kube_client` not supplied to PodManager. "
|
|
240
|
-
"This will be a required argument in a future release. "
|
|
241
|
-
"Please use KubernetesHook to create the client before calling.",
|
|
242
|
-
DeprecationWarning,
|
|
243
|
-
)
|
|
229
|
+
self._client = kube_client
|
|
244
230
|
self._watch = watch.Watch()
|
|
245
231
|
|
|
246
232
|
def run_pod_async(self, pod: V1Pod, **kwargs) -> V1Pod:
|
|
@@ -42,12 +42,18 @@ class PodDefaults:
|
|
|
42
42
|
resources=k8s.V1ResourceRequirements(
|
|
43
43
|
requests={
|
|
44
44
|
"cpu": "1m",
|
|
45
|
-
|
|
45
|
+
"memory": "10Mi",
|
|
46
|
+
},
|
|
46
47
|
),
|
|
47
48
|
)
|
|
48
49
|
|
|
49
50
|
|
|
50
|
-
def add_xcom_sidecar(
|
|
51
|
+
def add_xcom_sidecar(
|
|
52
|
+
pod: k8s.V1Pod,
|
|
53
|
+
*,
|
|
54
|
+
sidecar_container_image: str | None = None,
|
|
55
|
+
sidecar_container_resources: k8s.V1ResourceRequirements | dict | None = None,
|
|
56
|
+
) -> k8s.V1Pod:
|
|
51
57
|
"""Adds sidecar"""
|
|
52
58
|
pod_cp = copy.deepcopy(pod)
|
|
53
59
|
pod_cp.spec.volumes = pod.spec.volumes or []
|
|
@@ -56,6 +62,8 @@ def add_xcom_sidecar(pod: k8s.V1Pod, *, sidecar_container_image=None) -> k8s.V1P
|
|
|
56
62
|
pod_cp.spec.containers[0].volume_mounts.insert(0, PodDefaults.VOLUME_MOUNT)
|
|
57
63
|
sidecar = copy.deepcopy(PodDefaults.SIDECAR_CONTAINER)
|
|
58
64
|
sidecar.image = sidecar_container_image or PodDefaults.SIDECAR_CONTAINER.image
|
|
65
|
+
if sidecar_container_resources:
|
|
66
|
+
sidecar.resources = sidecar_container_resources
|
|
59
67
|
pod_cp.spec.containers.append(sidecar)
|
|
60
68
|
|
|
61
69
|
return pod_cp
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-cncf-kubernetes
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.0
|
|
4
4
|
Summary: Provider for Apache Airflow. Implements apache-airflow-providers-cncf-kubernetes package
|
|
5
5
|
Home-page: https://airflow.apache.org/
|
|
6
6
|
Download-URL: https://archive.apache.org/dist/airflow/providers
|
|
7
7
|
Author: Apache Software Foundation
|
|
8
8
|
Author-email: dev@airflow.apache.org
|
|
9
9
|
License: Apache License 2.0
|
|
10
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/
|
|
10
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/6.0.0/
|
|
11
11
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
12
12
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
13
13
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
@@ -30,7 +30,7 @@ Requires-Python: ~=3.7
|
|
|
30
30
|
Description-Content-Type: text/x-rst
|
|
31
31
|
License-File: LICENSE
|
|
32
32
|
License-File: NOTICE
|
|
33
|
-
Requires-Dist: apache-airflow (>=2.3.0
|
|
33
|
+
Requires-Dist: apache-airflow (>=2.3.0)
|
|
34
34
|
Requires-Dist: asgiref (>=3.5.2)
|
|
35
35
|
Requires-Dist: cryptography (>=2.0.0)
|
|
36
36
|
Requires-Dist: kubernetes (<24,>=21.7.0)
|
|
@@ -57,7 +57,7 @@ Requires-Dist: kubernetes-asyncio (<25,>=18.20.1)
|
|
|
57
57
|
|
|
58
58
|
Package ``apache-airflow-providers-cncf-kubernetes``
|
|
59
59
|
|
|
60
|
-
Release: ``
|
|
60
|
+
Release: ``6.0.0``
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
`Kubernetes <https://kubernetes.io/>`__
|
|
@@ -70,7 +70,7 @@ This is a provider package for ``cncf.kubernetes`` provider. All classes for thi
|
|
|
70
70
|
are in ``airflow.providers.cncf.kubernetes`` python package.
|
|
71
71
|
|
|
72
72
|
You can find package information and changelog for the provider
|
|
73
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/
|
|
73
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/6.0.0/>`_.
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
Installation
|
|
@@ -121,6 +121,24 @@ PIP package Version required
|
|
|
121
121
|
Changelog
|
|
122
122
|
---------
|
|
123
123
|
|
|
124
|
+
6.0.0
|
|
125
|
+
.....
|
|
126
|
+
|
|
127
|
+
Breaking changes
|
|
128
|
+
~~~~~~~~~~~~~~~~
|
|
129
|
+
|
|
130
|
+
Use ``kubernetes_default`` connection by default in the ``KubernetesPodOperator``.
|
|
131
|
+
|
|
132
|
+
* ``Use default connection id for KubernetesPodOperator (#28848)``
|
|
133
|
+
|
|
134
|
+
Features
|
|
135
|
+
~~~~~~~~
|
|
136
|
+
|
|
137
|
+
* ``Allow to set limits for XCOM container (#28125)``
|
|
138
|
+
|
|
139
|
+
.. Review and move the new changes to one of the sections above:
|
|
140
|
+
* ``Add mechanism to suspend providers (#30422)``
|
|
141
|
+
|
|
124
142
|
5.3.0
|
|
125
143
|
.....
|
|
126
144
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
airflow/providers/cncf/kubernetes/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
2
|
-
airflow/providers/cncf/kubernetes/get_provider_info.py,sha256=
|
|
2
|
+
airflow/providers/cncf/kubernetes/get_provider_info.py,sha256=73YVJwkDAQ-nqAn4GhNU-FJne3liktxEhI0ytr1Qf1g,4323
|
|
3
3
|
airflow/providers/cncf/kubernetes/python_kubernetes_script.jinja2,sha256=gUGBhBTFWIXjnjxTAjawWIacDwk2EDxoGEzVQYnlUT8,1741
|
|
4
4
|
airflow/providers/cncf/kubernetes/python_kubernetes_script.py,sha256=iY7FaEYzI3AnjcMfRQDHAlTh6Vb6pJfhtPL66VlsAwE,3343
|
|
5
5
|
airflow/providers/cncf/kubernetes/backcompat/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
@@ -7,10 +7,10 @@ airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py,sha2
|
|
|
7
7
|
airflow/providers/cncf/kubernetes/decorators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
8
8
|
airflow/providers/cncf/kubernetes/decorators/kubernetes.py,sha256=MpnsTUF88Qek3nB3Lcp28_YHg6krpWtng043rV0fYQw,6151
|
|
9
9
|
airflow/providers/cncf/kubernetes/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
10
|
-
airflow/providers/cncf/kubernetes/hooks/kubernetes.py,sha256=
|
|
10
|
+
airflow/providers/cncf/kubernetes/hooks/kubernetes.py,sha256=ymKVKmsq1Y8pn0RvA7HwoPD_J95ZrUEYxupMJuWawYU,23857
|
|
11
11
|
airflow/providers/cncf/kubernetes/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
12
12
|
airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py,sha256=X71-dqt2KbpTI5DyDos1418UaQtQ6iatVSA7GBMR8d0,1074
|
|
13
|
-
airflow/providers/cncf/kubernetes/operators/pod.py,sha256=
|
|
13
|
+
airflow/providers/cncf/kubernetes/operators/pod.py,sha256=Cj2NkvWBeT6A8bYU4hD1Sa2i6QMAVLFJ3XvALqoULJ0,37598
|
|
14
14
|
airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py,sha256=6gwgG5x4_ExXMfeuwBp5ve7upDZec6FEi7M5YMOwa38,4860
|
|
15
15
|
airflow/providers/cncf/kubernetes/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
16
16
|
airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py,sha256=dgxrsJUfoIkRJrHF9M1lvqfS6--TjhERnFTlAzFtG6g,5226
|
|
@@ -18,12 +18,12 @@ airflow/providers/cncf/kubernetes/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUf
|
|
|
18
18
|
airflow/providers/cncf/kubernetes/triggers/kubernetes_pod.py,sha256=djhrSfq9t0yiSTnWvzo5dCI_yMw4U4A8MbYRdA6F0AE,1072
|
|
19
19
|
airflow/providers/cncf/kubernetes/triggers/pod.py,sha256=cRnl6lRCYUL_KVHs3YaBCvEbPV7o5XSMzLWz2TpkvIg,10454
|
|
20
20
|
airflow/providers/cncf/kubernetes/utils/__init__.py,sha256=ClZN0VPjWySdVwS_ktH7rrgL9VLAcs3OSJSB9s3zaYw,863
|
|
21
|
-
airflow/providers/cncf/kubernetes/utils/pod_manager.py,sha256=
|
|
22
|
-
airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py,sha256=
|
|
23
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
24
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
25
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
26
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
27
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
28
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
29
|
-
apache_airflow_providers_cncf_kubernetes-
|
|
21
|
+
airflow/providers/cncf/kubernetes/utils/pod_manager.py,sha256=voikBvIAYgta_i1PNxlivlzOQ62bJ6vwY5kRrj7ddXY,21693
|
|
22
|
+
airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py,sha256=j6a2J8ifPYARuqZe6WbGOV7A5dY_dltUtJwdE4DwLkY,2642
|
|
23
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
|
24
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/METADATA,sha256=79_hWMnXj0mOTuwQKnjGjDlB65ybQArMJ32DhkX_YR0,32487
|
|
25
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/NOTICE,sha256=m-6s2XynUxVSUIxO4rVablAZCvFq-wmLrqV91DotRBw,240
|
|
26
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
27
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/entry_points.txt,sha256=GZl6SYJuUg-3koITGRd9PU1lBmqhecrKTeCQ6-wyHpM,112
|
|
28
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/top_level.txt,sha256=OeMVH5md7fr2QQWpnZoOWWxWO-0WH1IP70lpTVwopPg,8
|
|
29
|
+
apache_airflow_providers_cncf_kubernetes-6.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|