{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22770","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22770/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22770/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22770/events","html_url":"https://github.com/kubernetes/kubernetes/issues/22770","id":139778907,"number":22770,"title":"Unable to resolve hostname using `kubectl logs`","user":{"login":"ddysher","id":2191361,"avatar_url":"https://avatars.githubusercontent.com/u/2191361?v=3","gravatar_id":"","url":"https://api.github.com/users/ddysher","html_url":"https://github.com/ddysher","followers_url":"https://api.github.com/users/ddysher/followers","following_url":"https://api.github.com/users/ddysher/following{/other_user}","gists_url":"https://api.github.com/users/ddysher/gists{/gist_id}","starred_url":"https://api.github.com/users/ddysher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddysher/subscriptions","organizations_url":"https://api.github.com/users/ddysher/orgs","repos_url":"https://api.github.com/users/ddysher/repos","events_url":"https://api.github.com/users/ddysher/events{/privacy}","received_events_url":"https://api.github.com/users/ddysher/received_events","type":"User","site_admin":false},"labels":[{"id":114528273,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/P2","name":"priority/P2","color":"fbca04","default":false},{"id":173493835,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/CSI-API%20Machinery%20SIG","name":"team/CSI-API Machinery SIG","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2016-03-10T04:10:31Z","updated_at":"2016-11-27T17:48:53Z","closed_at":null,"body":"Using kubectl logs shows the following error:\n\n```\nError from server: Get https://node-1:10250/containerLogs/kube-system/kibana-logging-v1-x1hr3/kibana-logging: dial tcp: lookup node-1: no such host\n```\n\nKubernetes master uses nodeName to fetch logs from kubelet, which doesn't always resolve.  There are two workarounds as I can think of:\n1. Manually add host entry in master's /etc/hosts, but this doesn't scale;\n2. Use hostname override to use raw IP address. This is better, but raw IP is hard to manage and we see this error https://github.com/kubernetes/kubernetes/issues/22109\n\nSince master already have the mapping from nodeName to IPAddress, we can get rid of the problem by just using internal IP?\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/263136024","html_url":"https://github.com/kubernetes/kubernetes/issues/22770#issuecomment-263136024","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22770","id":263136024,"user":{"login":"mkulke","id":273280,"avatar_url":"https://avatars.githubusercontent.com/u/273280?v=3","gravatar_id":"","url":"https://api.github.com/users/mkulke","html_url":"https://github.com/mkulke","followers_url":"https://api.github.com/users/mkulke/followers","following_url":"https://api.github.com/users/mkulke/following{/other_user}","gists_url":"https://api.github.com/users/mkulke/gists{/gist_id}","starred_url":"https://api.github.com/users/mkulke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkulke/subscriptions","organizations_url":"https://api.github.com/users/mkulke/orgs","repos_url":"https://api.github.com/users/mkulke/repos","events_url":"https://api.github.com/users/mkulke/events{/privacy}","received_events_url":"https://api.github.com/users/mkulke/received_events","type":"User","site_admin":false},"created_at":"2016-11-27T17:48:53Z","updated_at":"2016-11-27T17:48:53Z","body":"I haven't had the time to test an 1.5 cluster yet, but from looking at the code, i guess what works now is: \r\n\r\n- Set something master-resolvable via `--hostname-override` on the kubelet.\r\n- Have the cloud-provider rename the node to something non-resolvable.\r\n\r\n@hectorj2f By default the node uses the node's hostname, so when you use `--hostname-override` with some non-resolvable display name (e.g. \"my-node-1\"), the master will not be able to talk to the kubelet, because by default the hostname will be preferred as means to talk to the kubelet.\r\n\r\nhowever in 1.5 there is also `--preferred-address-types` (https://github.com/kubernetes/kubernetes/blob/release-1.5/cmd/kube-apiserver/app/options/options.go#L112), which you can use to specify a priority list of comm options (Hostname, InternalIP, ExternalIP, LegacyHostIP).\r\n\r\nThe flag is not documented yet, but I think this should solve most issues around apiserver->kubelet comm."}}
{"actor":{"display_login":"mkulke"}}