Skip to main content

ToK8sContainer

Builds a Container based on the definition passed by the TaskExecutionContext. This involves applying all Flyte configuration including k8s plugins and resource requests.

def ToK8sContainer(
ctx: context.Context,
tCtx: pluginscore.TaskExecutionContext
) - > *v1.Container

Builds a Kubernetes Container based on the definition passed by the TaskExecutionContext. This involves applying all Flyte configuration including k8s plugins and resource requests.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and deadlines.
tCtxpluginscore.TaskExecutionContextThe task execution context, providing access to task metadata, inputs, outputs, and task templates required to build the container.

Returns

TypeDescription
*v1.ContainerA Kubernetes Container object configured with Flyte-specific settings and resource requests, or an error if the container cannot be built.