{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22717","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22717/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22717/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22717/events","html_url":"https://github.com/kubernetes/kubernetes/issues/22717","id":139416432,"number":22717,"title":"Can't use service IP from inside the pod that backs the service","user":{"login":"guoshimin","id":11787293,"avatar_url":"https://avatars.githubusercontent.com/u/11787293?v=3","gravatar_id":"","url":"https://api.github.com/users/guoshimin","html_url":"https://github.com/guoshimin","followers_url":"https://api.github.com/users/guoshimin/followers","following_url":"https://api.github.com/users/guoshimin/following{/other_user}","gists_url":"https://api.github.com/users/guoshimin/gists{/gist_id}","starred_url":"https://api.github.com/users/guoshimin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guoshimin/subscriptions","organizations_url":"https://api.github.com/users/guoshimin/orgs","repos_url":"https://api.github.com/users/guoshimin/repos","events_url":"https://api.github.com/users/guoshimin/events{/privacy}","received_events_url":"https://api.github.com/users/guoshimin/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":3,"created_at":"2016-03-08T22:45:20Z","updated_at":"2016-03-08T23:13:42Z","closed_at":null,"body":"To reproduce, create a pod running a simple HTTP server and create a service for it:\r\n\r\nweb-test.yaml\r\n```\r\n---\r\napiVersion: v1\r\nkind: ReplicationController\r\nmetadata:\r\n  labels:\r\n    app: web-test\r\n  name: web-test\r\n  namespace: default\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    app: web-test\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: web-test\r\n    spec:\r\n      containers:\r\n      - image: python:2.7\r\n        name: web-test\r\n        terminationMessagePath: /dev/termination-log\r\n        args:\r\n        - python\r\n        - -m\r\n        - SimpleHTTPServer\r\n        ports:\r\n        - containerPort: 8000\r\n      dnsPolicy: ClusterFirst\r\n      restartPolicy: Always\r\n      terminationGracePeriodSeconds: 30\r\n---\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: web-test\r\nspec:\r\n  ports:\r\n  - name: http\r\n    port: 8000\r\n  selector:\r\n    app: web-test\r\n  sessionAffinity: None\r\n  type: ClusterIP\r\n```\r\n```\r\nkubectl create -f web-test.yaml\r\n```\r\n\r\nI was able to curl it from another pod:\r\n```\r\n$ kubectl exec -it another-pod -- curl -v web-test:8000\r\n* Rebuilt URL to: web-test:8000/\r\n* Hostname was NOT found in DNS cache\r\n*   Trying 10.3.0.45...\r\n* Connected to web-test (10.3.0.45) port 8000 (#0)\r\n> GET / HTTP/1.1\r\n> User-Agent: curl/7.38.0\r\n> Host: web-test:8000\r\n> Accept: */*\r\n>\r\n* HTTP 1.0, assume close after body\r\n< HTTP/1.0 200 OK\r\n< Server: SimpleHTTP/0.6 Python/2.7.11\r\n< Date: Tue, 08 Mar 2016 22:43:06 GMT\r\n< Content-type: text/html; charset=UTF-8\r\n< Content-Length: 810\r\n<\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"><html>\r\n<title>Directory listing for /</title>\r\n<body>\r\n<h2>Directory listing for /</h2>\r\n<hr>\r\n<ul>\r\n<li><a href=\".dockerenv\">.dockerenv</a>\r\n<li><a href=\".dockerinit\">.dockerinit</a>\r\n<li><a href=\"bin/\">bin/</a>\r\n<li><a href=\"boot/\">boot/</a>\r\n<li><a href=\"dev/\">dev/</a>\r\n<li><a href=\"etc/\">etc/</a>\r\n<li><a href=\"home/\">home/</a>\r\n<li><a href=\"lib/\">lib/</a>\r\n<li><a href=\"lib64/\">lib64/</a>\r\n<li><a href=\"media/\">media/</a>\r\n<li><a href=\"mnt/\">mnt/</a>\r\n<li><a href=\"opt/\">opt/</a>\r\n<li><a href=\"proc/\">proc/</a>\r\n<li><a href=\"root/\">root/</a>\r\n<li><a href=\"run/\">run/</a>\r\n<li><a href=\"sbin/\">sbin/</a>\r\n<li><a href=\"srv/\">srv/</a>\r\n<li><a href=\"sys/\">sys/</a>\r\n<li><a href=\"tmp/\">tmp/</a>\r\n<li><a href=\"usr/\">usr/</a>\r\n<li><a href=\"var/\">var/</a>\r\n</ul>\r\n<hr>\r\n</body>\r\n</html>\r\n* Closing connection 0\r\n```\r\n\r\nBut curling from the web-test pod itself fails:\r\n```\r\n$ kubectl exec -it web-test-ts14s -- curl -v web-test:8000\r\n* Rebuilt URL to: web-test:8000/\r\n* Hostname was NOT found in DNS cache\r\n*   Trying 10.3.0.45...\r\n```\r\n\r\nWe are using v1.2.0-alpha.8."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/194012472","html_url":"https://github.com/kubernetes/kubernetes/issues/22717#issuecomment-194012472","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22717","id":194012472,"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},"created_at":"2016-03-08T23:13:42Z","updated_at":"2016-03-08T23:13:42Z","body":"can you paste the cmd args with which kubelet was started ?"}}