Skip to main content

Takes a deployment in your kubernetes cluster and turns its pod template into a KubernetesPodOperator object.

Project description

Airflow KubernetesPodOperatorFromDeployment

PyPI version PyPI license PyPI pyversions

Or airkupofrod for short, is a tiny package which does one thing - takes a deployment in your kubernetes cluster and turns allows you to use its pod template as a KubernetesPodOperator object. It does this by providing the KubernetesPodOperatorFromDeployment operator.

airkupofrod supports 1.10.9<=airflow<2

Installation and usage

Ensure your airflow image has the python package airkupofrod installed

pip install airkubofrod

Then in your dags:

from airkupofrod.operator import KubernetesPodOperatorFromDeployment

my_kupofrod_task = KubernetesPodOperatorFromDeployment(
    deployment_labels={"app": "my-app"}, # deployment labels to lookup by
    deployment_fields={"metadata.name": "my-app-deploy-template"}, # deployment fields to lookup by
    deployment_namespace="some-ns", # where the deployment lives
    namespace="default", # where the pod will be deployed
    task_id="my-kupofrod-task", 
    dag=dag,
    in_cluster=True, 
) 

You will also need to make sure that a service account attached to your airflow pods has the a role capable of listing deployments bound to it. See role-binding for an example of this.

This is in addition to the role bindings necessary for the KubernetesPodOperator to work which can be seen in the airflow helm chart

Developing

Skaffold is used to test and develop inside kubernetes.

After ensuring you have:

  • Skaffold
  • Helm
  • Some type of k8s cluster available

Run:

skaffold dev --force=false --cleanup=false --status-check=false --port-forward

Then navigate to http://localhost:8080 and enable and trigger a run of the test deployments dag.

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

airkupofrod-0.6.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

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

airkupofrod-0.6.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file airkupofrod-0.6.0.tar.gz.

File metadata

  • Download URL: airkupofrod-0.6.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for airkupofrod-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4947c77a7b0595a9239f585ea7d4bfbd5e8f1cdf5c8b812c4c4a254ea2f8f940
MD5 d768adbcf2de72a05cac4040529692a9
BLAKE2b-256 8f0b871a2d2440385174e2f56e763d1f64b2840f358ad29ce03737d9938c0e14

See more details on using hashes here.

File details

Details for the file airkupofrod-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: airkupofrod-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for airkupofrod-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db58e4dc9d816c6d2ec6ec18e22da31eecdff4afec20a3f5e5d999c576fa6a11
MD5 369600daf6a0ba4309177ecd5161a000
BLAKE2b-256 174d0cb2a5a4c283c5cee7d9cb85de88ab3a77c923d428f1cffc92eafe0b78a2

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