Kubernetes Executor¶. The kubernetes executor is introduced in Apache Airflow 1.10.0. The Kubernetes executor will create a new pod for every task instance.
10.01.2012 · secrets (list[airflow.kubernetes.secret.Secret]) – Kubernetes secrets to inject in the container. They can be exposed as environment vars or files in a volume. in_cluster – run kubernetes client with in_cluster configuration. cluster_context – context that points to kubernetes cluster.
These configuration values are created using two config classes built into Airflow - Volume and VolumeMount: Listing 11.32. from airflow.contrib.kubernetes.
from airflow.contrib.kubernetes.volume import Volume # noqa. from airflow.contrib.kubernetes.secret ... :param volume_mounts: volumeMounts for launched pod.
... as volume deploy_target='/var/secrets/google', # Name of Kubernetes Secret ... "pod" package from airflow.contrib.kubernetes and use # resources = pod.
volumes ( list[airflow.contrib.kubernetes.volume.Volume]) – volumes for launched pod. Includes ConfigMaps and PersistentVolumes. labels ( dict) – labels to apply to the Pod. startup_timeout_seconds ( int) – timeout in seconds to startup the pod. name ( str) – name of the task you want to run, will be used to generate a pod id.
10.01.2012 · The Airflow local settings file ( airflow_local_settings.py) can define a pod_mutation_hook function that has the ability to mutate pod objects before sending them to the Kubernetes client for scheduling. It receives a single argument as a reference to pod objects, and is expected to alter its attributes.
Kubernetes Executor¶. The kubernetes executor is introduced in Apache Airflow 1.10.0. The Kubernetes executor will create a new pod for every task instance. Example helm charts are available at scripts/ci/kubernetes/kube/ {airflow,volumes,postgres}.yaml in the source distribution. The volumes are optional and depend on your configuration.
04.11.2019 · DAG example using KubernetesPodOperator, the idea is run a Docker container in Kubernetes from Airflow every 30 minutes. Features: Scheduled every 30 minutes. Set environment variable for the pod RULES. Run the pods in the namespace default. Mount a volume to the container.