PodTemplate
Custom PodTemplate specification for a Task.
Attributes
| Attribute | Type | Description |
|---|---|---|
| pod_spec | V1PodSpec = None | The Kubernetes V1PodSpec object defining the pod's execution environment, including containers, volumes, and affinity rules. |
| primary_container_name | str = _PRIMARY_CONTAINER_DEFAULT_NAME | The name of the main container within the pod spec that executes the task logic. |
| labels | Dict[str, str] = None | A dictionary of key-value pairs used to organize and categorize the pod within the Kubernetes metadata. |
| annotations | Dict[str, str] = None | A dictionary of non-identifying metadata used to attach arbitrary information to the pod for use by tools and libraries. |
Constructor
Signature
def PodTemplate(
pod_spec: Optional[V1PodSpec] = None,
primary_container_name: str = _PRIMARY_CONTAINER_DEFAULT_NAME,
labels: Optional[Dict[str, str]] = None,
annotations: Optional[Dict[str, str]] = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| pod_spec | Optional[V1PodSpec] = None | The Kubernetes pod specification. |
| primary_container_name | str = _PRIMARY_CONTAINER_DEFAULT_NAME | The name of the primary container within the pod. |
| labels | Optional[Dict[str, str]] = None | A dictionary of labels to apply to the pod. |
| annotations | Optional[Dict[str, str]] = None | A dictionary of annotations to apply to the pod. |
Methods
to_k8s_pod()
@classmethod
def to_k8s_pod() - > K8sPod
Converts the PodTemplate instance into a Kubernetes Pod representation used by Flyte. This method serializes the pod specification and metadata into a format compatible with the Flyte backend.
Returns
| Type | Description |
|---|---|
K8sPod | A K8sPod object containing the serialized pod specification, metadata labels, annotations, and the designated primary container name. |