airflow.providers.cncf.kubernetes.k8s_model

Classes for interacting with Kubernetes API.

Module Contents

Classes

K8SModel

Airflow Kubernetes models are here for backwards compatibility reasons only.

Functions

append_to_pod(pod, k8s_objects)

Attach additional specs to an existing pod object.

class airflow.providers.cncf.kubernetes.k8s_model.K8SModel[source]

Bases: abc.ABC

Airflow Kubernetes models are here for backwards compatibility reasons only.

Ideally clients should use the kubernetes API and the process of

client input -> Airflow k8s models -> k8s models

can be avoided. All of these models implement the attach_to_pod method so that they integrate with the kubernetes client.

abstract attach_to_pod(pod)[source]

Attaches to pod.

Parameters

pod (kubernetes.client.models.V1Pod) – A pod to attach this Kubernetes object to

Returns

The pod with the object attached

Return type

kubernetes.client.models.V1Pod

airflow.providers.cncf.kubernetes.k8s_model.append_to_pod(pod, k8s_objects)[source]

Attach additional specs to an existing pod object.

Parameters
  • pod (kubernetes.client.models.V1Pod) – A pod to attach a list of Kubernetes objects to

  • k8s_objects (list[K8SModel] | None) – a potential None list of K8SModels

Returns

pod with the objects attached if they exist

Was this entry helpful?