flytekitplugins.pod.Pod#

class flytekitplugins.pod.Pod(pod_spec, primary_container_name='primary', labels=None, annotations=None)[source]#

Pod is a platform-wide configuration that uses pod templates. By default, every task is launched as a container in a pod. This plugin helps expose a fully modifiable Kubernetes pod spec to customize the task execution runtime. To use pod tasks: (1) Define a pod spec, and (2) Specify the primary container name. :param V1PodSpec pod_spec: Kubernetes pod spec. https://kubernetes.io/docs/concepts/workloads/pods :param str primary_container_name: the primary container name. If provided the pod-spec can contain a container whose name matches the primary_container_name. This will force Flyte to give up control of the primary

container and will expect users to control setting up the container. If you expect your python function to run as is, simply create containers that do not match the default primary-container-name and Flyte will auto-inject a container for the python function based on the default image provided during serialization.

Parameters
  • labels (Optional[Dict[str, str]]) – Labels are key/value pairs that are attached to pod spec

  • annotations (Optional[Dict[str, str]]) – Annotations are key/value pairs that are attached to arbitrary non-identifying metadata to pod spec.

  • pod_spec (kubernetes.client.models.v1_pod_spec.V1PodSpec) –

  • primary_container_name (str) –

  • labels

  • annotations

Return type

None

Methods

Attributes

annotations: Optional[Dict[str, str]] = None#
labels: Optional[Dict[str, str]] = None#
primary_container_name: str = 'primary'#
pod_spec: kubernetes.client.models.v1_pod_spec.V1PodSpec#