Skip to content
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

Modify comments on OnPodCreate function of svc plugin #547

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pkg/controllers/job/plugins/svc/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ func (sp *servicePlugin) addFlags() {
}

func (sp *servicePlugin) OnPodCreate(pod *v1.Pod, job *batch.Job) error {
// use podName.serviceName as default pod DNS domain
// Add `hostname` and `subdomain` for pod, mount service config for pod.
// A pod with `hostname` and `subdomain` will have the fully qualified domain name(FQDN)
// `hostname.subdomain.namespace.svc.cluster-domain.example`.
// If there exists a headless service in the same namespace as the pod and with the
// same name as the `subdomain`, the cluster's KubeDNS Server will returns an A record for
// the Pods's fully qualified hostname, pointing to the Pod’s IP.
// `hostname.subdomain` will be used as address of the pod.
// By default, a client Pod’s DNS search list will include the Pod’s own namespace and
// the cluster’s default domain, so the pod can be accessed by pods in the same namespace
// through the address of pod.
// More info: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service
if len(pod.Spec.Hostname) == 0 {
pod.Spec.Hostname = pod.Name
}
Expand Down