-
Notifications
You must be signed in to change notification settings - Fork 52
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
Move headless service creation outside of createJobs #483
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danielvegamyhre The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-jobset canceled.
|
@@ -143,6 +143,11 @@ func (r *JobSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr | |||
} | |||
} | |||
|
|||
// If pod DNS hostnames are enabled, create a headless service for the JobSet | |||
if err := r.createHeadlessSvcIfNecessary(ctx, &js); err != nil { |
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.
Maybe we could have a log here also?
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.
Added logging of the error here
/lgtm |
The fact that headless service creation is inside the createJobs function is a relic of the first JobSet release where we created 1 headless service per replicatedJob.
When we changed this to 1 headless service per JobSet, we should have moved this outside of the createJobs function, to better follow the single responsibility principle. The headless service creation now has no dependency on jobs or replicated jobs so we should move it out to the main reconcile loops before job creation begins.