-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use cluster uid and namespace instead of cluster "name" for Kubernetes job identifiers #7747
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
Conversation
…s job identifiers
✅ Deploy Preview for prefect-orion ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
This looks great! Using the namespace UID sure seems like the right way forward.
…s job identifiers (PrefectHQ#7747) Co-authored-by: peytonrunyan <peytonrunyan@gmail.com> Co-authored-by: Peyton <44583861+peytonrunyan@users.noreply.github.com>
FYI, this change appears to have created a dependency that the agent must now have access to the kube-system namespace in order to get the cluster UID.
|
Co-authored with @peytonrunyan
Closes #7739
Converts Kubernetes job PIDs from
{cluster_name}:{job_name}
to{cluster_uid}:{namespace}:{job_name}
. Cluster names can be arbitrarily set in the Kubernetes config and are not a reliable unique identifier. Additionally, the config does not exist when using an in-cluster agent or in cases like #7739. We generate a stable cluster UID from thekube-system
namespace UID as described in kubernetes/kubernetes#44954 — which tracks the lack of a Kubernetes API for retrieving a cluster identifier. I attempted to use the job UID instead of the job name because it is guaranteed to be unique across namespaces. However, there is not a clear way to look up a job by its UID later without listing all jobs. Instead, we include the namespace in the PID to ensure we do not kill jobs in the wrong namespace.Additionally, in #7701 the
KubernetesJobResult
returns were not updated to include the new identifier. Here, I do some minor refactoring to fix this.Example
Checklist
<link to issue>
"fix
,feature
,enhancement