rkt: Add '--hostname' support for rkt.

Add GeneratePodHostNameAndDomain() to RuntimeHelper to
get the hostname of the pod from kubelet.

Also update the logging flag to change the journal match from
_HOSTNAME to _MACHINE_ID.
This commit is contained in:
Yifan Gu
2016-03-21 14:28:57 -07:00
parent d814d973ff
commit d4dc037bf7
7 changed files with 51 additions and 11 deletions

View File

@@ -760,6 +760,10 @@ func (r *Runtime) generateRunCommand(pod *api.Pod, uuid string) (string, error)
if len(dnsServers) > 0 || len(dnsSearches) > 0 {
runPrepared = append(runPrepared, fmt.Sprintf("--dns-opt=%s", defaultDNSOption))
}
// TODO(yifan): host domain is not being used.
hostname, _ := r.runtimeHelper.GeneratePodHostNameAndDomain(pod)
runPrepared = append(runPrepared, fmt.Sprintf("--hostname=%s", hostname))
runPrepared = append(runPrepared, uuid)
return strings.Join(runPrepared, " "), nil
}