Skip to content

Conversation

@Owen-CH-Leung
Copy link
Contributor

@Owen-CH-Leung Owen-CH-Leung commented May 18, 2023

This PR extends the contributions of @joshuayeung, advancing the effort to integrate Istio support into the KubernetesPodOperator. Previous PR here

@boring-cyborg boring-cyborg bot added provider:cncf-kubernetes Kubernetes (k8s) provider related issues area:providers labels May 18, 2023
Fix failing spell check
@jedcunningham
Copy link
Member

My primary concern with this is that I don't think it'd work when is_delete_operator_pod is true - we can't just delete the pod in that situation, leaving the sidecar running. We should probably use /quitquitquit instead.

@eladkal
Copy link
Contributor

eladkal commented Jun 15, 2023

My primary concern with this is that I don't think it'd work when is_delete_operator_pod is true - we can't just delete the pod in that situation, leaving the sidecar running. We should probably use /quitquitquit instead.

There is a pending PR to deprecate this parameter in favor of a new approch.
#30718

@jedcunningham
Copy link
Member

Ah, yes, I forgot about that other PR. Either way, the concept of "keep the pod" will still be a thing.

@jtele2
Copy link

jtele2 commented Jul 1, 2023

Would love a status update on this PR as the kubernetesPodOperator is basically unuseable with istio at this point, unless someone can point me to a workaround?

Was as about to dig into the code for this PR to implent myself.

@Owen-CH-Leung
Copy link
Contributor Author

Would love a status update on this PR as the kubernetesPodOperator is basically unuseable with istio at this point, unless someone can point me to a workaround?

Was as about to dig into the code for this PR to implent myself.

I saw there're conflicts after #30718 was merged ytd. I'll work on resolving it in coming few days

@Owen-CH-Leung
Copy link
Contributor Author

@eladkal @jedcunningham Can I ask for your review for this PR again ? Thanks

@bruciebruce
Copy link

I could use this merged with what I am doing as well. Thank you.

@hussein-awala hussein-awala self-requested a review July 17, 2023 07:59
Comment on lines 156 to 180
def container_is_completed(pod: V1Pod, container_name: str) -> bool:
"""
Examines V1Pod ``pod`` to determine whether ``container_name`` is completed.
If that container is present and completed, returns True. Returns False otherwise.
"""
container_status = get_container_status(pod, container_name)
if not container_status:
return False
return container_status.state.terminated is not None


def container_is_succeeded(pod: V1Pod, container_name: str) -> bool:
"""
Examines V1Pod ``pod`` to determine whether ``container_name`` is completed and succeeded.
If that container is present and completed and succeeded, returns True. Returns False otherwise.
"""
if not container_is_completed(pod, container_name):
return False

container_status = get_container_status(pod, container_name)
if not container_status:
return False
return container_status.state.terminated.exit_code == 0


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a problem with the rebase/merge, because these methods exist already in main branch

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought they had been merged already, just waiting on the new release so I don't have to build from source to use this. But still very eagerly waiting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. You have conflict now and you are essentially 271 commits behind. I suggest you rebase rather than merge and solve conflicts you have now - it's not clear whether your merge has been done well. When you rebase you will see only your changes on top of the current main branch.

And yes, for changes like that, it can happen that it will take long time to merge them, and that you will have to resolve conflicts and rebase few times, and that you might have conflicts with other changes.

I strongly suggest to rebase it (and solve conflicts).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh... Sorry was too focused on making the code change & I performed merge instead of rebase. Will do rebase next time

state, or the execution is interrupted. If True (default), delete the
pod; if False, leave the pod.
Deprecated - use `on_finish_action` instead.
:param istio_enabled: Whether istio is enabled in k8s cluster. False by default.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can avoid adding a new argument, by adding a new option in OnFinishAction, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes definitely. I've removed the extra param and added a new option in OnFinishAction. The logic for await_pod_completion & process_pod_deletion is updated also.

@Owen-CH-Leung
Copy link
Contributor Author

Thanks all for your comments. I'll perform rebase & address the comments asap

eladkal and others added 4 commits August 9, 2023 15:25
* Makes pools respect deferrable tasks (with extra setting)

See apache#21243

This commit makes pools consider deferred tasks if the `include_deferred` flag is set. By default a pool will not consider deferred tasks as occupied slots, but still show the number of deferred tasks in its stats.

---------

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
bbovenzi and others added 5 commits August 9, 2023 09:37
The `airflow-github` tooling had a check if PR has been already
merged, but the PR did not work well when there was already a PR
cherry-picked that referred the PR in question in their log message.

The check was done via `git log --grep=#PR` essentially and so
it happenes that `--grep` matches not only the first line of
the message but the whole log message. So if the log message
contained reference to the cherry-picked PR it was seen as merged.

This change adds ( ) around and $ to the regexp to match not
only the PR number but also parentheses around.
@Owen-CH-Leung
Copy link
Contributor Author

There're failing helm tests with different executors...I'll try to fix them in coming few days

@eladkal
Copy link
Contributor

eladkal commented Aug 10, 2023

@Owen-CH-Leung looks like a bad rebase?

@Owen-CH-Leung
Copy link
Contributor Author

Apologize all. I think I've done sth wrong when rebasing / merging and this branch is too hard to continue to work on . I'll open a new branch to continue my work

@Owen-CH-Leung
Copy link
Contributor Author

@jedcunningham @hussein-awala @potiuk @eladkal I've created another PR as a continuation:

#33306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.