diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index e0e645bda7a..afc2b1284cf 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -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. diff --git a/cluster/gce/windows/k8s-node-setup.psm1 b/cluster/gce/windows/k8s-node-setup.psm1 index c0ed6f5aec7..5396c592e1c 100644 --- a/cluster/gce/windows/k8s-node-setup.psm1 +++ b/cluster/gce/windows/k8s-node-setup.psm1 @@ -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})"