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.

Parameters:
  • pod_spec (V1PodSpec) – Kubernetes pod spec. https://kubernetes.io/docs/concepts/workloads/pods

  • primary_container_name (str) – 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.

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

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

  • labels

  • annotations

Methods

Attributes

annotations: Dict[str, str] | None = None
labels: Dict[str, str] | None = None
primary_container_name: str = 'primary'
pod_spec: V1PodSpec