Replies: 2 comments 1 reply
-
|
Currently the KubernetesPodOperator doesn't support this kind of interaction between pods, and IMHO it should not support them. How can you achieve this? You need to add 2 more tasks:
The new dag will be: t_start >> pod1 >> t_end
t_start >> sensor_pod1 >> pod2 >> pod1_killer >> t_endWith this dag, pod1 and sensor_pod1 will be running in parallel, once pod1 is running, sensor_pod1 will be pass to success state, and pod2 will be executed. Then when it finishes, pod1_killer will be executed to stop pod1 (you need to be careful to avoid marking the task as failed), the t_end will be executed. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your prompt response, @hussein-awala. I truly appreciate it. That makes sense. I have another related question to KubernetesPodOperator/KPO. Since I need the KPO to run my default docker command, cmds argument cannot be set. If the cmds argument is not set, the KPO task will run in perpetuity. Is there a way to run the default docker command + some python argument so that it will trigger as success after running? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Community,
I need to run a KubernetesPodOperator (task 1) that will create a Pod (pull an image from a private repo). Then, I need to "do something" with the Pod in task 2. Hence, I need to run task 1 and task 2 in parallel, where task 2 will wait until pod in task 1 is up.
Here is the workflow: t_start >> [t1, t2] >> t_end.
The problem rises as task 1 will run in perpetuity since I don't issue cmds command. I can't use the cmds command because I need to use the default docker from the image that I pulled.
My question is how should I mark t1 as complete as soon as t2 is completed?
Beta Was this translation helpful? Give feedback.
All reactions