Move hostdns.conf out of cni directory.

This commit is contained in:
Lantao Liu 2019-11-27 11:46:12 -08:00
parent e66f4ca537
commit ee2418c7aa
2 changed files with 4 additions and 2 deletions

View File

@ -878,7 +878,7 @@ function construct-windows-kubelet-flags {
flags+=" --logtostderr=false"
# Configure the file path for host dns configuration
flags+=" --resolv-conf=${WINDOWS_CNI_CONFIG_DIR}\hostdns.conf"
flags+=" --resolv-conf=${WINDOWS_CNI_DIR}\hostdns.conf"
# Both --cgroups-per-qos and --enforce-node-allocatable should be disabled on
# windows; the latter requires the former to be enabled to work.

View File

@ -1004,7 +1004,9 @@ function Configure-HostDnsConf {
$conf = $conf + "nameserver $ip`r`n"
}
$conf = $conf + "search $search_list"
$hostdns_conf = "${env:CNI_CONFIG_DIR}\hostdns.conf"
# Do not put hostdns.conf into the CNI config directory so as to
# avoid the container runtime treating it as CNI config.
$hostdns_conf = "${env:CNI_DIR}\hostdns.conf"
New-Item -Force -ItemType file ${hostdns_conf} | Out-Null
Set-Content ${hostdns_conf} $conf
Log-Output "HOST dns conf:`n$(Get-Content -Raw ${hostdns_conf})"