-
Notifications
You must be signed in to change notification settings - Fork 984
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
Set DNSPolicy=ClusterFirstWithHostNet when hostnetwork set #779
Conversation
Signed-off-by: xuzhonghu <[email protected]>
@@ -57,6 +57,10 @@ func createJobPod(job *batch.Job, template *v1.PodTemplateSpec, ix int) *v1.Pod | |||
if len(pod.Spec.SchedulerName) == 0 { | |||
pod.Spec.SchedulerName = job.Spec.SchedulerName | |||
} | |||
// If dns policy not set when hostNetwork=true, set it to `ClusterFirstWithHostNet` | |||
if pod.Spec.HostNetwork == true && pod.Spec.DNSPolicy == "" { |
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.
can we add this into admission controller?
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.
yes, anyway makes sense to me
@@ -57,6 +57,10 @@ func createJobPod(job *batch.Job, template *v1.PodTemplateSpec, ix int) *v1.Pod | |||
if len(pod.Spec.SchedulerName) == 0 { | |||
pod.Spec.SchedulerName = job.Spec.SchedulerName |
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.
ditto, admission controller.
/approve |
@@ -57,6 +57,10 @@ func createJobPod(job *batch.Job, template *v1.PodTemplateSpec, ix int) *v1.Pod | |||
if len(pod.Spec.SchedulerName) == 0 { | |||
pod.Spec.SchedulerName = job.Spec.SchedulerName | |||
} | |||
// If dns policy not set when hostNetwork=true, set it to `ClusterFirstWithHostNet` | |||
if pod.Spec.HostNetwork == true && pod.Spec.DNSPolicy == "" { |
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.
Suggest the following syntax ?
if pod.Spec.HostNetwork && len(pod.Spec.DNSPolicy) == 0 {
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.
Yes, i must be drunk at that time
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu, k82cn 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 |
DefaultQueue = "default" | ||
|
||
defaultSchedulerName = "volcano" |
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.
Let's move this as an argument/parameter of admission, similar to DefaultQueue
.
#778