-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging support for init containers in KubernetesPodOperator (#42498) #43853
Conversation
providers/src/airflow/providers/cncf/kubernetes/operators/pod.py
Outdated
Show resolved
Hide resolved
@dstandish @jedcunningham @jscheffl @hussein-awala -> that one was submitted during the Man's Hackathon - I am not sure if I am competent enough to review the details, but it looks good at a first glance, I'd need someone more k8s-api-involved to review it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also only feel 50% competent, added some feedback from just code reading.
I am not an K8s expert, can init containers run in parallel? Or are they executed serial?
How about if init containers run for a longer time? Would it be interesting to stream logs while they are running to see progress? And if they run in parallel would it mix logs?
providers/src/airflow/providers/cncf/kubernetes/operators/pod.py
Outdated
Show resolved
Hide resolved
providers/src/airflow/providers/cncf/kubernetes/operators/pod.py
Outdated
Show resolved
Hide resolved
752e733
to
d23bd7b
Compare
Each init container runs sequentially, with each one waiting for the previous container to complete. The main containers wait until all init containers are ready before starting. Ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#understanding-init-containers
|
d58a784
to
c77bc4d
Compare
c0e0a1d
to
bbb224d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good, just need to check if the pod was started before you start reading the logs from init containers, the rest is nit.
providers/src/airflow/providers/cncf/kubernetes/operators/pod.py
Outdated
Show resolved
Hide resolved
15527a3
to
9baf12d
Compare
providers/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py
Outdated
Show resolved
Hide resolved
providers/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py
Outdated
Show resolved
Hide resolved
providers/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py
Outdated
Show resolved
Hide resolved
fb62e27
to
e710eae
Compare
Hi @jscheffl, @hussein-awala, @dstandish, @potiuk, @jedcunningham Does this PR need any additional changes? Are there any blockers we should address? Let me know how I can help to move it forward! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But I think some questions/answers need confirmation from @hussein-awala and @dstandish
Can you rebase in the meantime @mrk-andreev ? |
e710eae
to
5221d13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If no further comments I will merge this PR for next provider wave
Let's. I think it looks good. |
…che#42498) This change adds an option to print logs for init containers. The get_init_containers_logs and init_container_logs functions allow displaying the logs of init containers. Fixes: apache#42498
I rebased it - and let's give @dstandish and @hussein-awala last chance to comment. |
…che#42498) (apache#43853) This change adds an option to print logs for init containers. The get_init_containers_logs and init_container_logs functions allow displaying the logs of init containers. Fixes: apache#42498
…che#42498) (apache#43853) This change adds an option to print logs for init containers. The get_init_containers_logs and init_container_logs functions allow displaying the logs of init containers. Fixes: apache#42498
This change adds an option to print logs for init containers. The init_container_logs argument enables the display of logs specifically for spec.initContainers (not spec.containers).
Fixes: #42498