This commit is contained in:
shenjian@fangjia.com
2023-05-10 11:16:13 +08:00
parent 7adb2a18a7
commit c9ee9a2381
+4 -1
View File
@@ -3,6 +3,7 @@ from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import Kubernete
import pendulum import pendulum
from airflow import DAG from airflow import DAG
from docker.types import Mount from docker.types import Mount
from kubernetes.client import models as k8s
with DAG( with DAG(
dag_id="comm_add_dag", dag_id="comm_add_dag",
@@ -25,11 +26,13 @@ with DAG(
production_task = KubernetesPodOperator(namespace='airflow-plus', production_task = KubernetesPodOperator(namespace='airflow-plus',
# image="my-production-job:release-1.0.1", <-- old release # image="my-production-job:release-1.0.1", <-- old release
image="192.168.0.19:9012/comm-add:1.0.1", image="192.168.0.19:9012/comm-add:1.0.1",
image_pull_secrets=[k8s.V1LocalObjectReference("nexus-registry-secret")],
cmds=["Python", "-c"], cmds=["Python", "-c"],
arguments=["print('hello world')"], arguments=["print('hello world')"],
name="fail", name="fail",
task_id="failing-task", task_id="failing-task",
get_logs=True get_logs=True,
docker_conn_id="docker_repo"
) )
production_task production_task