{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/AKS/issues/667","repository_url":"https://api.github.com/repos/Azure/AKS","labels_url":"https://api.github.com/repos/Azure/AKS/issues/667/labels{/name}","comments_url":"https://api.github.com/repos/Azure/AKS/issues/667/comments","events_url":"https://api.github.com/repos/Azure/AKS/issues/667/events","html_url":"https://github.com/Azure/AKS/issues/667","id":364219317,"node_id":"MDU6SXNzdWUzNjQyMTkzMTc=","number":667,"title":"DNS lookup timeouts","user":{"login":"juan-lee","id":32657980,"node_id":"MDQ6VXNlcjMyNjU3OTgw","avatar_url":"https://avatars2.githubusercontent.com/u/32657980?v=4","gravatar_id":"","url":"https://api.github.com/users/juan-lee","html_url":"https://github.com/juan-lee","followers_url":"https://api.github.com/users/juan-lee/followers","following_url":"https://api.github.com/users/juan-lee/following{/other_user}","gists_url":"https://api.github.com/users/juan-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/juan-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juan-lee/subscriptions","organizations_url":"https://api.github.com/users/juan-lee/orgs","repos_url":"https://api.github.com/users/juan-lee/repos","events_url":"https://api.github.com/users/juan-lee/events{/privacy}","received_events_url":"https://api.github.com/users/juan-lee/received_events","type":"User","site_admin":false},"labels":[{"id":730885656,"node_id":"MDU6TGFiZWw3MzA4ODU2NTY=","url":"https://api.github.com/repos/Azure/AKS/labels/known-issue","name":"known-issue","color":"efdb83","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-26T21:30:20Z","updated_at":"2018-10-05T21:17:20Z","closed_at":null,"author_association":"COLLABORATOR","body":"**Symptoms**\r\nOutbound requests from pods can see a 5 second delay during DNS lookups. This is known to impact containers based off of the alpine image.\r\n\r\n**Root Cause**\r\nhttps://www.weave.works/blog/racy-conntrack-and-dns-lookup-timeouts\r\n\r\n**Workaround**\r\nAdd the following to your impacted pod's manifest.\r\n```\r\npostStart:\r\n  exec:\r\n    command:\r\n    - /bin/sh\r\n    - -c\r\n    - \"/bin/echo 'options single-request-reopen' >> /etc/resolv.conf\"\r\n```\r\n\r\n**What is single-request-reopen?**\r\n``` \r\nsingle-request-reopen (since glibc 2.9)\r\n  Sets RES_SNGLKUPREOP in _res.options.  The resolver\r\n  uses the same socket for the A and AAAA requests.  Some\r\n  hardware mistakenly sends back only one reply.  When\r\n  that happens the client system will sit and wait for\r\n  the second reply.  Turning this option on changes this\r\n  behavior so that if two requests from the same port are\r\n  not handled correctly it will close the socket and open\r\n  a new one before sending the second request.\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/AKS/issues/comments/427501286","html_url":"https://github.com/Azure/AKS/issues/667#issuecomment-427501286","issue_url":"https://api.github.com/repos/Azure/AKS/issues/667","id":427501286,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzUwMTI4Ng==","user":{"login":"AXington","id":2721182,"node_id":"MDQ6VXNlcjI3MjExODI=","avatar_url":"https://avatars2.githubusercontent.com/u/2721182?v=4","gravatar_id":"","url":"https://api.github.com/users/AXington","html_url":"https://github.com/AXington","followers_url":"https://api.github.com/users/AXington/followers","following_url":"https://api.github.com/users/AXington/following{/other_user}","gists_url":"https://api.github.com/users/AXington/gists{/gist_id}","starred_url":"https://api.github.com/users/AXington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AXington/subscriptions","organizations_url":"https://api.github.com/users/AXington/orgs","repos_url":"https://api.github.com/users/AXington/repos","events_url":"https://api.github.com/users/AXington/events{/privacy}","received_events_url":"https://api.github.com/users/AXington/received_events","type":"User","site_admin":false},"created_at":"2018-10-05T21:17:20Z","updated_at":"2018-10-05T21:17:20Z","author_association":"NONE","body":"This also works, and it works on alpine pods:\r\n\r\nhttps://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy\r\nservice/networking/custom-dns.yaml \r\napiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  namespace: default\r\n  name: dns-example\r\nspec:\r\n  containers:\r\n    - name: test\r\n      image: nginx\r\n  dnsPolicy: \"None\"\r\n  dnsConfig:\r\n    nameservers:\r\n      - 1.2.3.4\r\n    searches:\r\n      - ns1.svc.cluster.local\r\n      - my.dns.search.suffix\r\n    options:\r\n      - name: ndots\r\n        value: \"2\"\r\n      - name: edns0\r\n "}}
{"actor":{"display_login":"AXington"}}