-
Notifications
You must be signed in to change notification settings - Fork 773
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
feature: backwards compatible Kubernetes list and kill #2023
feature: backwards compatible Kubernetes list and kill #2023
Conversation
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! just need to enhance the killing logic so that it works internally.
* add fallbacks to kube kill * block killing pods managed by argo-workflows
# Metaflows Kubernetes job names are of the format | ||
# t-{uid}-{k8s_job_generate_name_suffix}-{k8s_pod_generate_name_suffix} | ||
# so we can infer the job name from the pod name by dropping the last suffix | ||
job_name = "-".join(pod.metadata.name.split("-")[:-1]) |
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.
could we get this from pod's owner reference instead?
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.
seems so, or upon further inspection its also part of the pod labels as well so I'll go with that as the simplest source
supersedes #1998 as the first attempt, as this approach is backwards compatible.
closes #1631
caveat
this approach iterates through all active pods in a namespace indiscriminately (with a limit of
1000
per request), only filtering on the client side for relevant ones. As a result, in deployments with enormous amounts of active pods, the operation can take quite long.