Skip to main content

A lightweight open-source framework for writing and deploying distributed data transformations on Kubernetes.

Project description

PyPI version

kube-transform

kube-transform is a lightweight open-source framework for writing and deploying distributed, batch-oriented data pipelines on Kubernetes.

It is intentionally thin — only ~1,000 lines of code — and designed to be an easy-to-understand layer between your code and Kubernetes. Unlike heavyweight orchestration platforms like Apache Airflow (which has hundreds of thousands of lines), kube-transform aims to be simple to reason about, debug, and extend.

It focuses on simplicity and flexibility:

  • Minimal required configuration
  • No persistent control plane components
  • Vendor-agnostic: compatible with any Kubernetes cluster, image, and file store that meet a few basic requirements

If you're looking for a quick way to get started, check out kube-transform-starter-kit for reusable setup resources like Dockerfiles, Terraform, and RBAC templates. But using the starter kit is entirely optional.


Requirements

Your setup must meet these basic requirements:

1. Deployment Inputs

To run a pipeline, you must provide:

  • pipeline_spec: A Python dictionary that conforms to the KTPipeline schema. You can optionally write your spec using the KTPipeline Pydantic model directly, and then call .model_dump() to convert it to a dict.
  • image_path: A string path to your Docker image
  • data_dir: A string path to your file store (must be valid from the perspective of pods running in the cluster)

2. Docker Image

  • Must include Python 3.11+
  • Must have kube-transform installed (e.g. via pip)
  • Must include your code in /app/kt_functions/, which should be an importable module containing the functions referenced in your pipeline

3. File Store ("DATA_DIR")

  • This is the directory that all pipeline jobs and the controller will read from and write to. It will be passed as the data_dir argument to run_pipeline().
  • Can be a local folder (e.g. /mnt/data) or a cloud object store (e.g. s3://some-bucket/)
  • Must be readable and writable by all pods in your cluster
  • Compatible with anything fsspec supports

The KT controller internally uses fsspec.open() to write pipeline metadata to DATA_DIR. You must ensure that DATA_DIR is transparently accessible to all pods (including the controller). This typically means one of the following:

  • You're using a mounted volume that is accessible at /mnt/data
  • You've configured access via IRSA (for S3) or Workload Identity (for GCS), so the kt-pod service account has permissions to access your object store

In a single-node cluster, simply mounting a local folder to /mnt/data will work. All KT pods will have access to /mnt/data.

4. Kubernetes Cluster

  • Must be able to pull your Docker image (e.g. via ECR, DockerHub, etc.)
  • Must be able to access your file store
  • Must include a service account named kt-pod in the default namespace, with permission to create Kubernetes Jobs
  • Your deployment machine must be able to connect to the cluster (e.g. via kubectl)

For a working example setup with autoscaling, IAM roles, and RBAC configuration, see kube-transform-starter-kit.


How to Run

Once your inputs are ready:

from kube_transform import run_pipeline

run_pipeline(pipeline_spec, image_path, data_dir)

This will:

  1. Launch a temporary kt-controller Job in your Kubernetes cluster
  2. Submit all pipeline jobs in the correct dependency order
  3. Shut down automatically when the pipeline completes (or fails)

You can view progress using:

kubectl get pods

Make sure you have the same version of kube-transform running locally (for the run_pipeline function) as you have in your image.


Autoscaling & Resource Management

kube-transform is compatible with both fixed-size and autoscaling clusters:

  • If your cluster supports autoscaling, KT will take advantage of it automatically.
  • If your cluster is fixed-size, jobs will remain in Pending state until resources are available.

For help setting up either configuration, see kube-transform-starter-kit.


Questions? Feature requests? Open an issue on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kube_transform-0.2.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kube_transform-0.2.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file kube_transform-0.2.0.tar.gz.

File metadata

  • Download URL: kube_transform-0.2.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for kube_transform-0.2.0.tar.gz
Algorithm Hash digest
SHA256 43678c93671141aa9e8770d240edea9666b5756eb3845ff5a1746dff2f4cb224
MD5 773381c9fc95a4bf935346dfcfd35d72
BLAKE2b-256 52d14aa26f0755a18d124cb15ac73ebd68cfe5245b8df4ca5611ea34efa81b95

See more details on using hashes here.

File details

Details for the file kube_transform-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: kube_transform-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for kube_transform-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fb09077181ba9177e28f450738f4ee79ae9d77972e7e95a16ec09b3c6847601
MD5 90fde9d88ddd6380c1dadf54b45cb7a5
BLAKE2b-256 1c86add0b9b2e3944ae1cbc4e1913a56aa87b1c803fa97991d42f5c50c4175a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page