apache-airflow-providers-cncf-kubernetes 3.1.0__py3-none-any.whl → 10.10.0rc1__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/__init__.py +18 -23
- airflow/providers/cncf/kubernetes/backcompat/__init__.py +17 -0
- airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py +31 -49
- airflow/providers/cncf/kubernetes/callbacks.py +200 -0
- airflow/providers/cncf/kubernetes/cli/__init__.py +16 -0
- airflow/providers/cncf/kubernetes/cli/kubernetes_command.py +195 -0
- airflow/providers/cncf/kubernetes/decorators/kubernetes.py +163 -0
- airflow/providers/cncf/kubernetes/decorators/kubernetes_cmd.py +118 -0
- airflow/providers/cncf/kubernetes/exceptions.py +37 -0
- airflow/providers/cncf/kubernetes/executors/__init__.py +17 -0
- airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py +831 -0
- airflow/providers/cncf/kubernetes/executors/kubernetes_executor_types.py +91 -0
- airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py +736 -0
- airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py +306 -0
- airflow/providers/cncf/kubernetes/get_provider_info.py +249 -50
- airflow/providers/cncf/kubernetes/hooks/kubernetes.py +846 -112
- airflow/providers/cncf/kubernetes/k8s_model.py +62 -0
- airflow/providers/cncf/kubernetes/kube_client.py +156 -0
- airflow/providers/cncf/kubernetes/kube_config.py +125 -0
- airflow/providers/cncf/kubernetes/kubernetes_executor_templates/__init__.py +16 -0
- airflow/providers/cncf/kubernetes/kubernetes_executor_templates/basic_template.yaml +79 -0
- airflow/providers/cncf/kubernetes/kubernetes_helper_functions.py +165 -0
- airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py +368 -0
- airflow/providers/cncf/kubernetes/operators/job.py +646 -0
- airflow/providers/cncf/kubernetes/operators/kueue.py +132 -0
- airflow/providers/cncf/kubernetes/operators/pod.py +1417 -0
- airflow/providers/cncf/kubernetes/operators/resource.py +191 -0
- airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py +336 -35
- airflow/providers/cncf/kubernetes/pod_generator.py +592 -0
- airflow/providers/cncf/kubernetes/pod_template_file_examples/__init__.py +16 -0
- airflow/providers/cncf/kubernetes/pod_template_file_examples/dags_in_image_template.yaml +68 -0
- airflow/providers/cncf/kubernetes/pod_template_file_examples/dags_in_volume_template.yaml +74 -0
- airflow/providers/cncf/kubernetes/pod_template_file_examples/git_sync_template.yaml +95 -0
- airflow/providers/cncf/kubernetes/python_kubernetes_script.jinja2 +51 -0
- airflow/providers/cncf/kubernetes/python_kubernetes_script.py +92 -0
- airflow/providers/cncf/kubernetes/resource_convert/__init__.py +16 -0
- airflow/providers/cncf/kubernetes/resource_convert/configmap.py +52 -0
- airflow/providers/cncf/kubernetes/resource_convert/env_variable.py +39 -0
- airflow/providers/cncf/kubernetes/resource_convert/secret.py +40 -0
- airflow/providers/cncf/kubernetes/secret.py +128 -0
- airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py +30 -14
- airflow/providers/cncf/kubernetes/template_rendering.py +81 -0
- airflow/providers/cncf/kubernetes/triggers/__init__.py +16 -0
- airflow/providers/cncf/kubernetes/triggers/job.py +176 -0
- airflow/providers/cncf/kubernetes/triggers/pod.py +344 -0
- airflow/providers/cncf/kubernetes/utils/__init__.py +3 -0
- airflow/providers/cncf/kubernetes/utils/container.py +118 -0
- airflow/providers/cncf/kubernetes/utils/delete_from.py +154 -0
- airflow/providers/cncf/kubernetes/utils/k8s_resource_iterator.py +46 -0
- airflow/providers/cncf/kubernetes/utils/pod_manager.py +887 -152
- airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py +25 -16
- airflow/providers/cncf/kubernetes/version_compat.py +38 -0
- apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/METADATA +125 -0
- apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/RECORD +62 -0
- {apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info → apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info}/WHEEL +1 -2
- apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/entry_points.txt +3 -0
- apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/licenses/NOTICE +5 -0
- airflow/providers/cncf/kubernetes/backcompat/pod.py +0 -119
- airflow/providers/cncf/kubernetes/backcompat/pod_runtime_info_env.py +0 -56
- airflow/providers/cncf/kubernetes/backcompat/volume.py +0 -62
- airflow/providers/cncf/kubernetes/backcompat/volume_mount.py +0 -58
- airflow/providers/cncf/kubernetes/example_dags/example_kubernetes.py +0 -163
- airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes.py +0 -66
- airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes_spark_pi.yaml +0 -57
- airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py +0 -622
- apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info/METADATA +0 -452
- apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info/NOTICE +0 -6
- apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info/RECORD +0 -29
- apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info/entry_points.txt +0 -3
- apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info/top_level.txt +0 -1
- /airflow/providers/cncf/kubernetes/{example_dags → decorators}/__init__.py +0 -0
- {apache_airflow_providers_cncf_kubernetes-3.1.0.dist-info → apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/licenses}/LICENSE +0 -0
|
@@ -14,44 +14,53 @@
|
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"""
|
|
17
|
+
"""Attach a sidecar container that blocks the pod from completing until Airflow pulls result data."""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
22
21
|
import copy
|
|
23
22
|
|
|
24
23
|
from kubernetes.client import models as k8s
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class PodDefaults:
|
|
28
|
-
"""Static defaults for Pods"""
|
|
27
|
+
"""Static defaults for Pods."""
|
|
29
28
|
|
|
30
|
-
XCOM_MOUNT_PATH =
|
|
31
|
-
SIDECAR_CONTAINER_NAME =
|
|
29
|
+
XCOM_MOUNT_PATH = "/airflow/xcom"
|
|
30
|
+
SIDECAR_CONTAINER_NAME = "airflow-xcom-sidecar"
|
|
32
31
|
XCOM_CMD = 'trap "exit 0" INT; while true; do sleep 1; done;'
|
|
33
|
-
VOLUME_MOUNT = k8s.V1VolumeMount(name=
|
|
34
|
-
VOLUME = k8s.V1Volume(name=
|
|
32
|
+
VOLUME_MOUNT = k8s.V1VolumeMount(name="xcom", mount_path=XCOM_MOUNT_PATH)
|
|
33
|
+
VOLUME = k8s.V1Volume(name="xcom", empty_dir=k8s.V1EmptyDirVolumeSource())
|
|
35
34
|
SIDECAR_CONTAINER = k8s.V1Container(
|
|
36
35
|
name=SIDECAR_CONTAINER_NAME,
|
|
37
|
-
command=[
|
|
38
|
-
image=
|
|
36
|
+
command=["sh", "-c", XCOM_CMD],
|
|
37
|
+
image="alpine",
|
|
39
38
|
volume_mounts=[VOLUME_MOUNT],
|
|
40
39
|
resources=k8s.V1ResourceRequirements(
|
|
41
40
|
requests={
|
|
42
41
|
"cpu": "1m",
|
|
43
|
-
|
|
42
|
+
"memory": "10Mi",
|
|
43
|
+
},
|
|
44
44
|
),
|
|
45
45
|
)
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def add_xcom_sidecar(
|
|
49
|
-
|
|
48
|
+
def add_xcom_sidecar(
|
|
49
|
+
pod: k8s.V1Pod,
|
|
50
|
+
*,
|
|
51
|
+
sidecar_container_image: str | None = None,
|
|
52
|
+
sidecar_container_resources: k8s.V1ResourceRequirements | dict | None = None,
|
|
53
|
+
) -> k8s.V1Pod:
|
|
54
|
+
"""Add sidecar."""
|
|
50
55
|
pod_cp = copy.deepcopy(pod)
|
|
51
56
|
pod_cp.spec.volumes = pod.spec.volumes or []
|
|
52
57
|
pod_cp.spec.volumes.insert(0, PodDefaults.VOLUME)
|
|
53
58
|
pod_cp.spec.containers[0].volume_mounts = pod_cp.spec.containers[0].volume_mounts or []
|
|
54
59
|
pod_cp.spec.containers[0].volume_mounts.insert(0, PodDefaults.VOLUME_MOUNT)
|
|
55
|
-
|
|
60
|
+
sidecar = copy.deepcopy(PodDefaults.SIDECAR_CONTAINER)
|
|
61
|
+
sidecar.image = sidecar_container_image or PodDefaults.SIDECAR_CONTAINER.image
|
|
62
|
+
if sidecar_container_resources:
|
|
63
|
+
sidecar.resources = sidecar_container_resources
|
|
64
|
+
pod_cp.spec.containers.append(sidecar)
|
|
56
65
|
|
|
57
66
|
return pod_cp
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
|
3
|
+
# distributed with this work for additional information
|
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
|
6
|
+
# "License"); you may not use this file except in compliance
|
|
7
|
+
# with the License. You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
#
|
|
18
|
+
# NOTE! THIS FILE IS COPIED MANUALLY IN OTHER PROVIDERS DELIBERATELY TO AVOID ADDING UNNECESSARY
|
|
19
|
+
# DEPENDENCIES BETWEEN PROVIDERS. IF YOU WANT TO ADD CONDITIONAL CODE IN YOUR PROVIDER THAT DEPENDS
|
|
20
|
+
# ON AIRFLOW VERSION, PLEASE COPY THIS FILE TO THE ROOT PACKAGE OF YOUR PROVIDER AND IMPORT
|
|
21
|
+
# THOSE CONSTANTS FROM IT RATHER THAN IMPORTING THEM FROM ANOTHER PROVIDER OR TEST CODE
|
|
22
|
+
#
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def get_base_airflow_version_tuple() -> tuple[int, int, int]:
|
|
27
|
+
from packaging.version import Version
|
|
28
|
+
|
|
29
|
+
from airflow import __version__
|
|
30
|
+
|
|
31
|
+
airflow_version = Version(__version__)
|
|
32
|
+
return airflow_version.major, airflow_version.minor, airflow_version.micro
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
|
|
36
|
+
AIRFLOW_V_3_1_PLUS = get_base_airflow_version_tuple() >= (3, 1, 0)
|
|
37
|
+
|
|
38
|
+
__all__ = ["AIRFLOW_V_3_0_PLUS", "AIRFLOW_V_3_1_PLUS"]
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apache-airflow-providers-cncf-kubernetes
|
|
3
|
+
Version: 10.10.0rc1
|
|
4
|
+
Summary: Provider package apache-airflow-providers-cncf-kubernetes for Apache Airflow
|
|
5
|
+
Keywords: airflow-provider,cncf.kubernetes,airflow,integration
|
|
6
|
+
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
7
|
+
Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/x-rst
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Framework :: Apache Airflow
|
|
17
|
+
Classifier: Framework :: Apache Airflow :: Provider
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: System :: Monitoring
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
License-File: NOTICE
|
|
25
|
+
Requires-Dist: aiofiles>=23.2.0
|
|
26
|
+
Requires-Dist: apache-airflow>=2.10.0rc1
|
|
27
|
+
Requires-Dist: apache-airflow-providers-common-compat>=1.8.0rc1
|
|
28
|
+
Requires-Dist: asgiref>=3.5.2
|
|
29
|
+
Requires-Dist: cryptography>=41.0.0,<46.0.0
|
|
30
|
+
Requires-Dist: kubernetes>=32.0.0,<35.0.0
|
|
31
|
+
Requires-Dist: kubernetes_asyncio>=32.0.0,<35.0.0
|
|
32
|
+
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
33
|
+
Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.10.0/changelog.html
|
|
34
|
+
Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.10.0
|
|
35
|
+
Project-URL: Mastodon, https://fosstodon.org/@airflow
|
|
36
|
+
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
37
|
+
Project-URL: Source Code, https://github.com/apache/airflow
|
|
38
|
+
Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
.. Licensed to the Apache Software Foundation (ASF) under one
|
|
42
|
+
or more contributor license agreements. See the NOTICE file
|
|
43
|
+
distributed with this work for additional information
|
|
44
|
+
regarding copyright ownership. The ASF licenses this file
|
|
45
|
+
to you under the Apache License, Version 2.0 (the
|
|
46
|
+
"License"); you may not use this file except in compliance
|
|
47
|
+
with the License. You may obtain a copy of the License at
|
|
48
|
+
|
|
49
|
+
.. http://www.apache.org/licenses/LICENSE-2.0
|
|
50
|
+
|
|
51
|
+
.. Unless required by applicable law or agreed to in writing,
|
|
52
|
+
software distributed under the License is distributed on an
|
|
53
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
54
|
+
KIND, either express or implied. See the License for the
|
|
55
|
+
specific language governing permissions and limitations
|
|
56
|
+
under the License.
|
|
57
|
+
|
|
58
|
+
.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
|
|
59
|
+
|
|
60
|
+
.. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
61
|
+
``PROVIDER_README_TEMPLATE.rst.jinja2`` IN the ``dev/breeze/src/airflow_breeze/templates`` DIRECTORY
|
|
62
|
+
|
|
63
|
+
Package ``apache-airflow-providers-cncf-kubernetes``
|
|
64
|
+
|
|
65
|
+
Release: ``10.10.0``
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
`Kubernetes <https://kubernetes.io/>`__
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Provider package
|
|
72
|
+
----------------
|
|
73
|
+
|
|
74
|
+
This is a provider package for ``cncf.kubernetes`` provider. All classes for this provider package
|
|
75
|
+
are in ``airflow.providers.cncf.kubernetes`` python package.
|
|
76
|
+
|
|
77
|
+
You can find package information and changelog for the provider
|
|
78
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.10.0/>`_.
|
|
79
|
+
|
|
80
|
+
Installation
|
|
81
|
+
------------
|
|
82
|
+
|
|
83
|
+
You can install this package on top of an existing Airflow installation (see ``Requirements`` below
|
|
84
|
+
for the minimum Airflow version supported) via
|
|
85
|
+
``pip install apache-airflow-providers-cncf-kubernetes``
|
|
86
|
+
|
|
87
|
+
The package supports the following python versions: 3.10,3.11,3.12,3.13
|
|
88
|
+
|
|
89
|
+
Requirements
|
|
90
|
+
------------
|
|
91
|
+
|
|
92
|
+
========================================== ====================
|
|
93
|
+
PIP package Version required
|
|
94
|
+
========================================== ====================
|
|
95
|
+
``aiofiles`` ``>=23.2.0``
|
|
96
|
+
``apache-airflow`` ``>=2.10.0``
|
|
97
|
+
``apache-airflow-providers-common-compat`` ``>=1.8.0``
|
|
98
|
+
``asgiref`` ``>=3.5.2``
|
|
99
|
+
``cryptography`` ``>=41.0.0,<46.0.0``
|
|
100
|
+
``kubernetes`` ``>=32.0.0,<35.0.0``
|
|
101
|
+
``kubernetes_asyncio`` ``>=32.0.0,<35.0.0``
|
|
102
|
+
========================================== ====================
|
|
103
|
+
|
|
104
|
+
Cross provider package dependencies
|
|
105
|
+
-----------------------------------
|
|
106
|
+
|
|
107
|
+
Those are dependencies that might be needed in order to use all the features of the package.
|
|
108
|
+
You need to install the specified providers in order to use them.
|
|
109
|
+
|
|
110
|
+
You can install such cross-provider dependencies when installing from PyPI. For example:
|
|
111
|
+
|
|
112
|
+
.. code-block:: bash
|
|
113
|
+
|
|
114
|
+
pip install apache-airflow-providers-cncf-kubernetes[common.compat]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
================================================================================================================== =================
|
|
118
|
+
Dependent package Extra
|
|
119
|
+
================================================================================================================== =================
|
|
120
|
+
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
|
|
121
|
+
================================================================================================================== =================
|
|
122
|
+
|
|
123
|
+
The changelog for the provider package can be found in the
|
|
124
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.10.0/changelog.html>`_.
|
|
125
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
airflow/providers/cncf/kubernetes/__init__.py,sha256=sNnyDVLE3RiR85dOsTdjZbfX_6-IOzWAwUJxqcoUygY,1506
|
|
2
|
+
airflow/providers/cncf/kubernetes/callbacks.py,sha256=1nCLXFJKtr5FM9ApB8Drw5VAGSC3TDFsPSTMtRnAR3Q,6085
|
|
3
|
+
airflow/providers/cncf/kubernetes/exceptions.py,sha256=EGvP2n8c43t58e_-SAWpMopQxzX6PJmaflo1HP-RTY4,1403
|
|
4
|
+
airflow/providers/cncf/kubernetes/get_provider_info.py,sha256=7fYqFWd1K0j8LgVkB_HYambOGPTrBDuaVXenLUPtF8g,16600
|
|
5
|
+
airflow/providers/cncf/kubernetes/k8s_model.py,sha256=xmdFhX29DjegoZ-cq8-KDL9soVYXf4OpU6fAGr3cPTU,2101
|
|
6
|
+
airflow/providers/cncf/kubernetes/kube_client.py,sha256=AaTY2UhhKVa-qrhMvpiQjdUJhrQyndwQ_5PoRmWJy3k,5714
|
|
7
|
+
airflow/providers/cncf/kubernetes/kube_config.py,sha256=UsxzPjsonzy5a6e0P8XjenT-ncmX4R6KB1EqDfWpLnM,6191
|
|
8
|
+
airflow/providers/cncf/kubernetes/kubernetes_helper_functions.py,sha256=IuGf9U-jKlL8h2u_npPsC7WBr9SpAgb-oMOmlcjFxxY,5624
|
|
9
|
+
airflow/providers/cncf/kubernetes/pod_generator.py,sha256=0VEcAtT2SzAFwSDsQWe2QdrY2mDV8s4hBw0qLcmIMGw,21038
|
|
10
|
+
airflow/providers/cncf/kubernetes/python_kubernetes_script.jinja2,sha256=I0EHRGwLHjSiX85e51HBIoddRDnC8TJPFrDBqQq_NJg,1776
|
|
11
|
+
airflow/providers/cncf/kubernetes/python_kubernetes_script.py,sha256=KnTlZSWCZhwvj89fSc2kgIRTaI4iLNKPquHc2wXnluo,3460
|
|
12
|
+
airflow/providers/cncf/kubernetes/secret.py,sha256=0aHyYJOnveutfQKH7riAfz9IPB5hhDYBDYzYEDuXrmU,5317
|
|
13
|
+
airflow/providers/cncf/kubernetes/template_rendering.py,sha256=WSUBhjGSDhjNtA4IFlbYyX50rvYN6UA4dMk0cPqgOjo,3618
|
|
14
|
+
airflow/providers/cncf/kubernetes/version_compat.py,sha256=DjaeLV-sLSz4WqmMThVH2CPp5eS4Q_nRj62kNSXugdU,1659
|
|
15
|
+
airflow/providers/cncf/kubernetes/backcompat/__init__.py,sha256=KXF76f3v1jIFUBNz8kwxVMvm7i4mNo35LbIG9IijBNc,1299
|
|
16
|
+
airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py,sha256=FkRRtIEucp2hYrecGVYVgyPI6-b7hE7X7L17Z3r459Y,4303
|
|
17
|
+
airflow/providers/cncf/kubernetes/cli/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
18
|
+
airflow/providers/cncf/kubernetes/cli/kubernetes_command.py,sha256=S6CBIaBm2wa-XisPKcn1Axy1fErIvCt9RwPn4gawGXc,8297
|
|
19
|
+
airflow/providers/cncf/kubernetes/decorators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
20
|
+
airflow/providers/cncf/kubernetes/decorators/kubernetes.py,sha256=IHgVEUabKmrP_MdnYN0FKIdpLMaaSqzdqLVE1nSSI_o,6203
|
|
21
|
+
airflow/providers/cncf/kubernetes/decorators/kubernetes_cmd.py,sha256=XZqfsVUhHBP1rPuT20uueoyv-Pr7i08_chmQHDtHHXs,4677
|
|
22
|
+
airflow/providers/cncf/kubernetes/executors/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
23
|
+
airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py,sha256=Kmn8Go_yJXkS7MPscubDDGe2q_sa9LL7NoYmH2y3OKA,35072
|
|
24
|
+
airflow/providers/cncf/kubernetes/executors/kubernetes_executor_types.py,sha256=F0IlLbC6qKMVNZwqnbgUPxwFsZdcRhot2kwBhzc9gSM,2698
|
|
25
|
+
airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py,sha256=wNvHSyGkEWFIPzxzinE5DhM2K4JTYDdIMqJxZCkGWNo,31503
|
|
26
|
+
airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py,sha256=CWCN4b6Ircs-3tCxJjBsrjl4Q0ABBJIwqlZr7a5lW6k,12243
|
|
27
|
+
airflow/providers/cncf/kubernetes/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
28
|
+
airflow/providers/cncf/kubernetes/hooks/kubernetes.py,sha256=6PerH9keut_mNd1wZJgUHjyDFbNPF6Z9ihIciKD6lCE,40290
|
|
29
|
+
airflow/providers/cncf/kubernetes/kubernetes_executor_templates/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
30
|
+
airflow/providers/cncf/kubernetes/kubernetes_executor_templates/basic_template.yaml,sha256=yzJmXN4ZyB4aDwI_GIugpL9-f1YMVy__X-LQSbeU95A,2567
|
|
31
|
+
airflow/providers/cncf/kubernetes/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
32
|
+
airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py,sha256=8Pysyo_iScGAD_fW5TDk0qeyoUfNgQCZpr8z47mYm4g,15447
|
|
33
|
+
airflow/providers/cncf/kubernetes/operators/job.py,sha256=B4C3CbcJTnhqJQmMAbvWrvQGAU8_gfyOmYbsJ1NvraA,26896
|
|
34
|
+
airflow/providers/cncf/kubernetes/operators/kueue.py,sha256=iDyw9hYaMWVLtBwjsmSXLsSoWW-uEEvh8stptgKOFVQ,5543
|
|
35
|
+
airflow/providers/cncf/kubernetes/operators/pod.py,sha256=aTep9YyHQX9F5gTqt3WT1uNu1775RYovqdBA7X6CqYo,64084
|
|
36
|
+
airflow/providers/cncf/kubernetes/operators/resource.py,sha256=hm-ZVhqS08CiF1Csmd06KxAr40oelehuxUOwaSh30D0,7695
|
|
37
|
+
airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py,sha256=I_e1Jj4Y_xjapA5MH_sYa1P5ROF10JA5Xf2V4HYg5pQ,15991
|
|
38
|
+
airflow/providers/cncf/kubernetes/pod_template_file_examples/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
39
|
+
airflow/providers/cncf/kubernetes/pod_template_file_examples/dags_in_image_template.yaml,sha256=7JdppZ-XDBpv2Bnde2SthhcME8w3b8xQdPAK1fJGW60,2256
|
|
40
|
+
airflow/providers/cncf/kubernetes/pod_template_file_examples/dags_in_volume_template.yaml,sha256=-Pk_EwKpyWRYZKOnumUxVrDeAfFJ0nr3WZ7JNnvppzg,2442
|
|
41
|
+
airflow/providers/cncf/kubernetes/pod_template_file_examples/git_sync_template.yaml,sha256=Pxpa1AiBlf4H8aIc7tUTmH2XNOz84cO0ttMQdlfMJ2c,3020
|
|
42
|
+
airflow/providers/cncf/kubernetes/resource_convert/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
43
|
+
airflow/providers/cncf/kubernetes/resource_convert/configmap.py,sha256=gf7DdVeD0yKRNCTVCM-SywJDxwEJTYx3ogykAqbxRoU,1873
|
|
44
|
+
airflow/providers/cncf/kubernetes/resource_convert/env_variable.py,sha256=vBeR__dLHsG619rxHTmY1SSefSTdUhnD4HRKzzQJutM,1462
|
|
45
|
+
airflow/providers/cncf/kubernetes/resource_convert/secret.py,sha256=ElZCMbTWeTKoPeIJ1fTvlqRXM8nGkWj2MrIlVckX6Ag,1494
|
|
46
|
+
airflow/providers/cncf/kubernetes/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
47
|
+
airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py,sha256=ml5DPNzIUGa6VazENjuq-Hj5G6a04GO6YGo8tNH5ubY,5371
|
|
48
|
+
airflow/providers/cncf/kubernetes/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
49
|
+
airflow/providers/cncf/kubernetes/triggers/job.py,sha256=_lLP6ZYRV4kdwb7U0w5QFnlY1E9deZ5wtg-nrlfl6-8,7505
|
|
50
|
+
airflow/providers/cncf/kubernetes/triggers/pod.py,sha256=uqfMVdhqmGH1Du3Cyo9ltc0Vn7jYb80xrahLuD54pxE,14810
|
|
51
|
+
airflow/providers/cncf/kubernetes/utils/__init__.py,sha256=ClZN0VPjWySdVwS_ktH7rrgL9VLAcs3OSJSB9s3zaYw,863
|
|
52
|
+
airflow/providers/cncf/kubernetes/utils/container.py,sha256=tuhWyMZrqCGDUT4kzwjhEgJrr0JvD9lMXbFeuMDoh-4,4813
|
|
53
|
+
airflow/providers/cncf/kubernetes/utils/delete_from.py,sha256=poObZSoEJwQyaYWilEURs8f4CDY2sn_pfwS31Lf579A,5195
|
|
54
|
+
airflow/providers/cncf/kubernetes/utils/k8s_resource_iterator.py,sha256=pl-G-2WhZVbewKkwmL9AxPo1hAQWHHEPK43b-ruF4-w,1937
|
|
55
|
+
airflow/providers/cncf/kubernetes/utils/pod_manager.py,sha256=hgW7GJwic5Jwz07i4ABHgwnu36zwuHogpBkgiMSJVuM,45208
|
|
56
|
+
airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py,sha256=k6bdmVJ21OrAwGmWwledRrAmaty9ZrmbuM-IbaI4mqo,2519
|
|
57
|
+
apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/entry_points.txt,sha256=ByD3QJJyP9CfmTYtpNI1953akD38RUDgpGXLaq9vpOw,111
|
|
58
|
+
apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
|
59
|
+
apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/licenses/NOTICE,sha256=E3-_E02gwwSEFzeeWPKmnIjOoos3hW28CLISV6sYrbQ,168
|
|
60
|
+
apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
61
|
+
apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/METADATA,sha256=OaMSPebQ_k2PKhr_355YJAIpjwLGf8ogsg0UFYadWyw,5753
|
|
62
|
+
apache_airflow_providers_cncf_kubernetes-10.10.0rc1.dist-info/RECORD,,
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
"""
|
|
18
|
-
Classes for interacting with Kubernetes API.
|
|
19
|
-
|
|
20
|
-
This module is deprecated. Please use :mod:`kubernetes.client.models.V1ResourceRequirements`
|
|
21
|
-
and :mod:`kubernetes.client.models.V1ContainerPort`.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
import warnings
|
|
25
|
-
|
|
26
|
-
from kubernetes.client import models as k8s
|
|
27
|
-
|
|
28
|
-
warnings.warn(
|
|
29
|
-
(
|
|
30
|
-
"This module is deprecated. Please use `kubernetes.client.models.V1ResourceRequirements`"
|
|
31
|
-
" and `kubernetes.client.models.V1ContainerPort`."
|
|
32
|
-
),
|
|
33
|
-
DeprecationWarning,
|
|
34
|
-
stacklevel=2,
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class Resources:
|
|
39
|
-
"""backwards compat for Resources."""
|
|
40
|
-
|
|
41
|
-
__slots__ = (
|
|
42
|
-
'request_memory',
|
|
43
|
-
'request_cpu',
|
|
44
|
-
'limit_memory',
|
|
45
|
-
'limit_cpu',
|
|
46
|
-
'limit_gpu',
|
|
47
|
-
'request_ephemeral_storage',
|
|
48
|
-
'limit_ephemeral_storage',
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
"""
|
|
52
|
-
:param request_memory: requested memory
|
|
53
|
-
:param request_cpu: requested CPU number
|
|
54
|
-
:param request_ephemeral_storage: requested ephemeral storage
|
|
55
|
-
:param limit_memory: limit for memory usage
|
|
56
|
-
:param limit_cpu: Limit for CPU used
|
|
57
|
-
:param limit_gpu: Limits for GPU used
|
|
58
|
-
:param limit_ephemeral_storage: Limit for ephemeral storage
|
|
59
|
-
"""
|
|
60
|
-
|
|
61
|
-
def __init__(
|
|
62
|
-
self,
|
|
63
|
-
request_memory=None,
|
|
64
|
-
request_cpu=None,
|
|
65
|
-
request_ephemeral_storage=None,
|
|
66
|
-
limit_memory=None,
|
|
67
|
-
limit_cpu=None,
|
|
68
|
-
limit_gpu=None,
|
|
69
|
-
limit_ephemeral_storage=None,
|
|
70
|
-
):
|
|
71
|
-
self.request_memory = request_memory
|
|
72
|
-
self.request_cpu = request_cpu
|
|
73
|
-
self.request_ephemeral_storage = request_ephemeral_storage
|
|
74
|
-
self.limit_memory = limit_memory
|
|
75
|
-
self.limit_cpu = limit_cpu
|
|
76
|
-
self.limit_gpu = limit_gpu
|
|
77
|
-
self.limit_ephemeral_storage = limit_ephemeral_storage
|
|
78
|
-
|
|
79
|
-
def to_k8s_client_obj(self):
|
|
80
|
-
"""
|
|
81
|
-
Converts to k8s object.
|
|
82
|
-
|
|
83
|
-
@rtype: object
|
|
84
|
-
"""
|
|
85
|
-
limits_raw = {
|
|
86
|
-
'cpu': self.limit_cpu,
|
|
87
|
-
'memory': self.limit_memory,
|
|
88
|
-
'nvidia.com/gpu': self.limit_gpu,
|
|
89
|
-
'ephemeral-storage': self.limit_ephemeral_storage,
|
|
90
|
-
}
|
|
91
|
-
requests_raw = {
|
|
92
|
-
'cpu': self.request_cpu,
|
|
93
|
-
'memory': self.request_memory,
|
|
94
|
-
'ephemeral-storage': self.request_ephemeral_storage,
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
limits = {k: v for k, v in limits_raw.items() if v}
|
|
98
|
-
requests = {k: v for k, v in requests_raw.items() if v}
|
|
99
|
-
resource_req = k8s.V1ResourceRequirements(limits=limits, requests=requests)
|
|
100
|
-
return resource_req
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class Port:
|
|
104
|
-
"""POD port"""
|
|
105
|
-
|
|
106
|
-
__slots__ = ('name', 'container_port')
|
|
107
|
-
|
|
108
|
-
def __init__(self, name=None, container_port=None):
|
|
109
|
-
"""Creates port"""
|
|
110
|
-
self.name = name
|
|
111
|
-
self.container_port = container_port
|
|
112
|
-
|
|
113
|
-
def to_k8s_client_obj(self):
|
|
114
|
-
"""
|
|
115
|
-
Converts to k8s object.
|
|
116
|
-
|
|
117
|
-
:rtype: object
|
|
118
|
-
"""
|
|
119
|
-
return k8s.V1ContainerPort(name=self.name, container_port=self.container_port)
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
"""
|
|
18
|
-
Classes for interacting with Kubernetes API.
|
|
19
|
-
|
|
20
|
-
This module is deprecated. Please use :mod:`kubernetes.client.models.V1EnvVar`.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
import warnings
|
|
24
|
-
|
|
25
|
-
import kubernetes.client.models as k8s
|
|
26
|
-
|
|
27
|
-
warnings.warn(
|
|
28
|
-
"This module is deprecated. Please use `kubernetes.client.models.V1EnvVar`.",
|
|
29
|
-
DeprecationWarning,
|
|
30
|
-
stacklevel=2,
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class PodRuntimeInfoEnv:
|
|
35
|
-
"""Defines Pod runtime information as environment variable."""
|
|
36
|
-
|
|
37
|
-
def __init__(self, name, field_path):
|
|
38
|
-
"""
|
|
39
|
-
Adds Kubernetes pod runtime information as environment variables such as namespace, pod IP, pod name.
|
|
40
|
-
Full list of options can be found in kubernetes documentation.
|
|
41
|
-
|
|
42
|
-
:param name: the name of the environment variable
|
|
43
|
-
:param field_path: path to pod runtime info. Ex: metadata.namespace | status.podIP
|
|
44
|
-
"""
|
|
45
|
-
self.name = name
|
|
46
|
-
self.field_path = field_path
|
|
47
|
-
|
|
48
|
-
def to_k8s_client_obj(self):
|
|
49
|
-
"""Converts to k8s object.
|
|
50
|
-
|
|
51
|
-
:return: kubernetes.client.models.V1EnvVar
|
|
52
|
-
"""
|
|
53
|
-
return k8s.V1EnvVar(
|
|
54
|
-
name=self.name,
|
|
55
|
-
value_from=k8s.V1EnvVarSource(field_ref=k8s.V1ObjectFieldSelector(field_path=self.field_path)),
|
|
56
|
-
)
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
"""This module is deprecated. Please use :mod:`kubernetes.client.models.V1Volume`."""
|
|
18
|
-
|
|
19
|
-
import warnings
|
|
20
|
-
|
|
21
|
-
from kubernetes.client import models as k8s
|
|
22
|
-
|
|
23
|
-
warnings.warn(
|
|
24
|
-
"This module is deprecated. Please use `kubernetes.client.models.V1Volume`.",
|
|
25
|
-
DeprecationWarning,
|
|
26
|
-
stacklevel=2,
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class Volume:
|
|
31
|
-
"""Backward compatible Volume"""
|
|
32
|
-
|
|
33
|
-
def __init__(self, name, configs):
|
|
34
|
-
"""Adds Kubernetes Volume to pod. allows pod to access features like ConfigMaps
|
|
35
|
-
and Persistent Volumes
|
|
36
|
-
|
|
37
|
-
:param name: the name of the volume mount
|
|
38
|
-
:param configs: dictionary of any features needed for volume. We purposely keep this
|
|
39
|
-
vague since there are multiple volume types with changing configs.
|
|
40
|
-
"""
|
|
41
|
-
self.name = name
|
|
42
|
-
self.configs = configs
|
|
43
|
-
|
|
44
|
-
def to_k8s_client_obj(self) -> k8s.V1Volume:
|
|
45
|
-
"""
|
|
46
|
-
Converts to k8s object.
|
|
47
|
-
|
|
48
|
-
:return: Volume Mount k8s object
|
|
49
|
-
"""
|
|
50
|
-
resp = k8s.V1Volume(name=self.name)
|
|
51
|
-
for k, v in self.configs.items():
|
|
52
|
-
snake_key = Volume._convert_to_snake_case(k)
|
|
53
|
-
if hasattr(resp, snake_key):
|
|
54
|
-
setattr(resp, snake_key, v)
|
|
55
|
-
else:
|
|
56
|
-
raise AttributeError(f"V1Volume does not have attribute {k}")
|
|
57
|
-
return resp
|
|
58
|
-
|
|
59
|
-
# source: https://www.geeksforgeeks.org/python-program-to-convert-camel-case-string-to-snake-case/
|
|
60
|
-
@staticmethod
|
|
61
|
-
def _convert_to_snake_case(input_string):
|
|
62
|
-
return ''.join('_' + i.lower() if i.isupper() else i for i in input_string).lstrip('_')
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
-
# or more contributor license agreements. See the NOTICE file
|
|
3
|
-
# distributed with this work for additional information
|
|
4
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
-
# to you under the Apache License, Version 2.0 (the
|
|
6
|
-
# "License"); you may not use this file except in compliance
|
|
7
|
-
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
"""Classes for interacting with Kubernetes API"""
|
|
18
|
-
|
|
19
|
-
import warnings
|
|
20
|
-
|
|
21
|
-
from kubernetes.client import models as k8s
|
|
22
|
-
|
|
23
|
-
warnings.warn(
|
|
24
|
-
"This module is deprecated. Please use `kubernetes.client.models.V1VolumeMount`.",
|
|
25
|
-
DeprecationWarning,
|
|
26
|
-
stacklevel=2,
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class VolumeMount:
|
|
31
|
-
"""Backward compatible VolumeMount"""
|
|
32
|
-
|
|
33
|
-
__slots__ = ('name', 'mount_path', 'sub_path', 'read_only')
|
|
34
|
-
|
|
35
|
-
def __init__(self, name, mount_path, sub_path, read_only):
|
|
36
|
-
"""
|
|
37
|
-
Initialize a Kubernetes Volume Mount. Used to mount pod level volumes to
|
|
38
|
-
running container.
|
|
39
|
-
|
|
40
|
-
:param name: the name of the volume mount
|
|
41
|
-
:param mount_path:
|
|
42
|
-
:param sub_path: subpath within the volume mount
|
|
43
|
-
:param read_only: whether to access pod with read-only mode
|
|
44
|
-
"""
|
|
45
|
-
self.name = name
|
|
46
|
-
self.mount_path = mount_path
|
|
47
|
-
self.sub_path = sub_path
|
|
48
|
-
self.read_only = read_only
|
|
49
|
-
|
|
50
|
-
def to_k8s_client_obj(self) -> k8s.V1VolumeMount:
|
|
51
|
-
"""
|
|
52
|
-
Converts to k8s object.
|
|
53
|
-
|
|
54
|
-
:return: Volume Mount k8s object
|
|
55
|
-
"""
|
|
56
|
-
return k8s.V1VolumeMount(
|
|
57
|
-
name=self.name, mount_path=self.mount_path, sub_path=self.sub_path, read_only=self.read_only
|
|
58
|
-
)
|