{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17406","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17406/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17406/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17406/events","html_url":"https://github.com/kubernetes/kubernetes/issues/17406","id":117485967,"number":17406,"title":"Allow DnsPolicy=ClusterFirst for Pods with hostNetwork: true","user":{"login":"ArtfulCoder","id":1220660,"avatar_url":"https://avatars.githubusercontent.com/u/1220660?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtfulCoder","html_url":"https://github.com/ArtfulCoder","followers_url":"https://api.github.com/users/ArtfulCoder/followers","following_url":"https://api.github.com/users/ArtfulCoder/following{/other_user}","gists_url":"https://api.github.com/users/ArtfulCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtfulCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtfulCoder/subscriptions","organizations_url":"https://api.github.com/users/ArtfulCoder/orgs","repos_url":"https://api.github.com/users/ArtfulCoder/repos","events_url":"https://api.github.com/users/ArtfulCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ArtfulCoder/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/cluster","name":"team/cluster","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-11-18T00:46:48Z","updated_at":"2016-04-30T05:28:25Z","closed_at":null,"body":"With 1.1, we allow pods to be created with hostNetwork = true.\r\nThese pods should be allowed to use Cluster DNS, if the pod spec says so.\r\n\r\nWe have already wired the kube-proxy to support traffic from the host machine to be directed to kube-services. We should similarly allow cluster dns names to be looked up by pods with hostNetwork=true.\r\n\r\nThis way, pods can use hostNetwork = true and still leverage kubernetes' service discovery mechanisms.\r\n\r\n\r\nI currently have a use case, where I am writing a GCE Firewall pod, that configures iptables on the nodes. This pod needs to run with hostNetwork=true to configure iptables and the same time needs to look up a kubernetes pod service to read some metadata.\r\nRefer to #17405\r\nhttps://github.com/ArtfulCoder/kubernetes/blob/prototype2/contrib/gce-firewall/client.yaml#L19\r\n\r\nCurrently, I have hard-coded a Kubernetes service-ip since we dont have cluster dns for hostNetworked-pods.  This is hardly a workable solution.\r\n\r\n\r\nI would imagine that third-party network plugins would also face similar issues if they try to do a clean implementation.\r\n\r\nOption 2:\r\nThe other option is to query API server to do service discovery. But this doesn't seem like a clean solution, especially since we have put in so much effort into our DNS based service discovery approach."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/215939725","html_url":"https://github.com/kubernetes/kubernetes/issues/17406#issuecomment-215939725","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17406","id":215939725,"user":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"created_at":"2016-04-30T05:28:24Z","updated_at":"2016-04-30T05:28:24Z","body":"Opening for reconsideration."}}