kubernetes: Nameserver not set when dnsPolicy=None
What happened: DNS Servers remain unchanged. Output of azure-vnet.log:
2019/02/25 20:14:00 [net] Creating endpoint &{Id:f678908e-eth0 ContainerID:f678908e06fedbc0b1410070e08ea3deacae60ba206150fc393037f17fee3f43 NetNsPath:none IfName:eth0 SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix:default.svc.cluster.local Servers:[10.0.0.10 168.63.129.16]} IPAddresses:[{IP:10.240.0.32 Mask:fff00000}] InfraVnetIP:{IP:<nil> Mask:<nil>} Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} Src:<nil> Gw:10.240.0.1 Protocol:0 DevName: Scope:0}] Policies:[{Type:EndpointPolicy Data:[123 34 69 120 99 101 112 116 105 111 110 76 105 115 116 34 58 91 34 49 48 46 50 52 48 46 48 46 48 47 49 50 34 44 34 49 48 46 50 52 48 46 48 46 48 47 49 50 34 93 44 34 84 121 112 101 34 58 34 79 117 116 66 111 117 110 100 78 65 84 34 125]} {Type:EndpointPolicy Data:[123 34 68 101 115 116 105 110 97 116 105 111 110 80 114 101 102 105 120 34 58 34 49 48 46 48 46 48 46 48 47 49 54 34 44 34 78 101 101 100 69 110 99 97 112 34 58 116 114 117 101 44 34 84 121 112 101 34 58 34 82 79 85 84 69 34 125]}] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false PODName:dns-utils PODNameSpace:default Data:map[] InfraVnetAddressSpace:} in network azure.
2019/02/25 20:14:00 [net] HNSEndpointRequest POST request:{"Name":"f678908e-eth0","VirtualNetwork":"7E1A6E80-5EFA-4C39-BE5F-342ECDD86C74","Policies":[{"Type":"OutBoundNAT","ExceptionList":["10.240.0.0/12","10.240.0.0/12"]},{"DestinationPrefix":"10.0.0.0/16","NeedEncap":true,"Type":"ROUTE"}],"IPAddress":"10.240.0.32","DNSSuffix":"default.svc.cluster.local","DNSServerList":"10.0.0.10,168.63.129.16","PrefixLength":12}
What you expected to happen: DNS Servers should have changed to 8.8.8.8.
How to reproduce it (as minimally and precisely as possible): Create a pod on a Windows node using the yaml below and check the output of azure-vnet.log to see if the DNS Servers have changed to 8.8.8.8.
apiVersion: v1
kind: Pod
metadata:
namespace: default
name: dns-utils
spec:
containers:
- name: util
image: claudiubelu/dnsutils:1.1
command: ["powershell", "sleep", "1000"]
dnsPolicy: "None"
dnsConfig:
nameservers:
- 8.8.8.8
Anything else we need to know?:
Environment:
- Kubernetes version (use
kubectl version
): v1.13.3 - Cloud provider or hardware configuration: Azure
- OS (e.g:
cat /etc/os-release
): Windows Server Datacenter - Kernel (e.g.
uname -a
): 10.0.17763.316 - Install tools:
- Others:
/sig windows /kind bug
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (14 by maintainers)
Sorry, forgot to update, the runtime DNS was merged in https://github.com/containernetworking/plugins/pull/271