{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/comments/57665874","id":57665874,"diff_hunk":"@@ -4,19 +4,19 @@\n * TOC\n {:toc}\n \n-# The Kubernetes model for connecting containers\n+# Kubernetes容器连接模型\n \n-Now that you have a continuously running, replicated application you can expose it on a network. Before discussing the Kubernetes approach to networking, it is worthwhile to contrast it with the \"normal\" way networking works with Docker.\n+既然已经有了一个可持续运行的多副本应用，现在就可以在网络中将它暴露出来了。在讨论Kubernetes的网络连接方式之前，很值得和Docker的常规网络连接方式做个对比。\n \n-By default, Docker uses host-private networking, so containers can talk to other containers only if they are on the same machine. In order for Docker containers to communicate across nodes, they must be allocated ports on the machine's own IP address, which are then forwarded or proxied to the containers. This obviously means that containers must either coordinate which ports they use very carefully or else be allocated ports dynamically.\n+Dokcer默认使用主机私有网络连接方式，所以只有在同一台物理机器上的容器之间才可以通信。为了让Docker容器可以跨节点通信，必须要给机器的IP地址分配端口号，这个端口之后会被用来转发或者路由给容器。很明显，这意味着容器要么要很小心地协调端口的使用，要么能动态地分配端口。\n \n-Coordinating ports across multiple developers is very difficult to do at scale and exposes users to cluster-level issues outside of their control. Kubernetes assumes that pods can communicate with other pods, regardless of which host they land on. We give every pod its own cluster-private-IP address so you do not need to explicitly create links between pods or mapping container ports to host ports. This means that containers within a Pod can all reach each other's ports on localhost, and all pods in a cluster can see each other without NAT. The rest of this document will elaborate on how you can run reliable services on such a networking model.\n+大规模地为多个开发者协调端口号不仅非常困难，而且会把无法把控的集群级别的问题暴露在用户面前。Kubernetes假定Pod之间是可以通信的，不管它们运行在哪个主机上。我们给每个Pod指定集群私有的IP地址（cluster-private-IP address），所以不需要显示地创建Pod之间的链接，也不需要映射容器的端口到主机的端口。这意味着Pod里的容器可以用localhost访问各自的端口，而且在没有NAT的情况下，集群中所有的Pod也互相可见。本文剩下的内容将会详细阐述如何在这样的网络模型中运行可靠的服务。","path":"docs/user-guide/connecting-applications.md","position":14,"original_position":14,"commit_id":"871ab58f2961d012d452d49b075fe8eb412bd6f9","original_commit_id":"871ab58f2961d012d452d49b075fe8eb412bd6f9","user":{"login":"resouer","id":1701782,"avatar_url":"https://avatars.githubusercontent.com/u/1701782?v=3","gravatar_id":"","url":"https://api.github.com/users/resouer","html_url":"https://github.com/resouer","followers_url":"https://api.github.com/users/resouer/followers","following_url":"https://api.github.com/users/resouer/following{/other_user}","gists_url":"https://api.github.com/users/resouer/gists{/gist_id}","starred_url":"https://api.github.com/users/resouer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resouer/subscriptions","organizations_url":"https://api.github.com/users/resouer/orgs","repos_url":"https://api.github.com/users/resouer/repos","events_url":"https://api.github.com/users/resouer/events{/privacy}","received_events_url":"https://api.github.com/users/resouer/received_events","type":"User","site_admin":false},"body":"与Docker不同，Kubernetes默认假设Pod之间本来是可以直接通信的（这个假设的成立依赖于底层IaaS网络或者用户自己配置，后续文档会有说明），而不管这些Pod分散在哪些主机上。而对于任意一个Pod来说，Kubernetes以Pod为单位分配一个集群私有的IP地址（cluster-private-IP address），所以我们不需要显示地创建容器之间的链接（比如docker link），也不需要映射容器的端口到主机的端口。...","created_at":"2016-03-29T02:47:52Z","updated_at":"2016-03-29T02:47:52Z","html_url":"https://github.com/kubernetes/kubernetes-docs-cn/pull/18#discussion_r57665874","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/comments/57665874"},"html":{"href":"https://github.com/kubernetes/kubernetes-docs-cn/pull/18#discussion_r57665874"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18","id":64328120,"html_url":"https://github.com/kubernetes/kubernetes-docs-cn/pull/18","diff_url":"https://github.com/kubernetes/kubernetes-docs-cn/pull/18.diff","patch_url":"https://github.com/kubernetes/kubernetes-docs-cn/pull/18.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues/18","number":18,"state":"open","locked":false,"title":"[Issue #8] Doc docs/user-guide/connecting-applications.md translated","user":{"login":"iT2afL0rd","id":9377699,"avatar_url":"https://avatars.githubusercontent.com/u/9377699?v=3","gravatar_id":"","url":"https://api.github.com/users/iT2afL0rd","html_url":"https://github.com/iT2afL0rd","followers_url":"https://api.github.com/users/iT2afL0rd/followers","following_url":"https://api.github.com/users/iT2afL0rd/following{/other_user}","gists_url":"https://api.github.com/users/iT2afL0rd/gists{/gist_id}","starred_url":"https://api.github.com/users/iT2afL0rd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iT2afL0rd/subscriptions","organizations_url":"https://api.github.com/users/iT2afL0rd/orgs","repos_url":"https://api.github.com/users/iT2afL0rd/repos","events_url":"https://api.github.com/users/iT2afL0rd/events{/privacy}","received_events_url":"https://api.github.com/users/iT2afL0rd/received_events","type":"User","site_admin":false},"body":"* Ready for review @hurf  @linfan   \r\n* The issue: #8 ","created_at":"2016-03-28T14:40:53Z","updated_at":"2016-03-29T02:47:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45c845e88c469dcec49ece08d5c07900a88ca717","assignee":{"login":"resouer","id":1701782,"avatar_url":"https://avatars.githubusercontent.com/u/1701782?v=3","gravatar_id":"","url":"https://api.github.com/users/resouer","html_url":"https://github.com/resouer","followers_url":"https://api.github.com/users/resouer/followers","following_url":"https://api.github.com/users/resouer/following{/other_user}","gists_url":"https://api.github.com/users/resouer/gists{/gist_id}","starred_url":"https://api.github.com/users/resouer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resouer/subscriptions","organizations_url":"https://api.github.com/users/resouer/orgs","repos_url":"https://api.github.com/users/resouer/repos","events_url":"https://api.github.com/users/resouer/events{/privacy}","received_events_url":"https://api.github.com/users/resouer/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues/18/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/statuses/871ab58f2961d012d452d49b075fe8eb412bd6f9","head":{"label":"iT2afL0rd:connecting-applications","ref":"connecting-applications","sha":"871ab58f2961d012d452d49b075fe8eb412bd6f9","user":{"login":"iT2afL0rd","id":9377699,"avatar_url":"https://avatars.githubusercontent.com/u/9377699?v=3","gravatar_id":"","url":"https://api.github.com/users/iT2afL0rd","html_url":"https://github.com/iT2afL0rd","followers_url":"https://api.github.com/users/iT2afL0rd/followers","following_url":"https://api.github.com/users/iT2afL0rd/following{/other_user}","gists_url":"https://api.github.com/users/iT2afL0rd/gists{/gist_id}","starred_url":"https://api.github.com/users/iT2afL0rd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iT2afL0rd/subscriptions","organizations_url":"https://api.github.com/users/iT2afL0rd/orgs","repos_url":"https://api.github.com/users/iT2afL0rd/repos","events_url":"https://api.github.com/users/iT2afL0rd/events{/privacy}","received_events_url":"https://api.github.com/users/iT2afL0rd/received_events","type":"User","site_admin":false},"repo":{"id":54648559,"name":"kubernetes-docs-cn","full_name":"iT2afL0rd/kubernetes-docs-cn","owner":{"login":"iT2afL0rd","id":9377699,"avatar_url":"https://avatars.githubusercontent.com/u/9377699?v=3","gravatar_id":"","url":"https://api.github.com/users/iT2afL0rd","html_url":"https://github.com/iT2afL0rd","followers_url":"https://api.github.com/users/iT2afL0rd/followers","following_url":"https://api.github.com/users/iT2afL0rd/following{/other_user}","gists_url":"https://api.github.com/users/iT2afL0rd/gists{/gist_id}","starred_url":"https://api.github.com/users/iT2afL0rd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iT2afL0rd/subscriptions","organizations_url":"https://api.github.com/users/iT2afL0rd/orgs","repos_url":"https://api.github.com/users/iT2afL0rd/repos","events_url":"https://api.github.com/users/iT2afL0rd/events{/privacy}","received_events_url":"https://api.github.com/users/iT2afL0rd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iT2afL0rd/kubernetes-docs-cn","description":"Chinese-language Kubernetes documentation","fork":true,"url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn","forks_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/forks","keys_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/teams","hooks_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/hooks","issue_events_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/issues/events{/number}","events_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/events","assignees_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/assignees{/user}","branches_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/branches{/branch}","tags_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/tags","blobs_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/git/refs{/sha}","trees_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/statuses/{sha}","languages_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/languages","stargazers_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/stargazers","contributors_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/contributors","subscribers_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/subscribers","subscription_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/subscription","commits_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/commits{/sha}","git_commits_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/git/commits{/sha}","comments_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/comments{/number}","issue_comment_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/issues/comments{/number}","contents_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/contents/{+path}","compare_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/merges","archive_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/downloads","issues_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/issues{/number}","pulls_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/pulls{/number}","milestones_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/milestones{/number}","notifications_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/labels{/name}","releases_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/releases{/id}","deployments_url":"https://api.github.com/repos/iT2afL0rd/kubernetes-docs-cn/deployments","created_at":"2016-03-24T14:33:35Z","updated_at":"2016-03-24T14:33:36Z","pushed_at":"2016-03-28T14:37:15Z","git_url":"git://github.com/iT2afL0rd/kubernetes-docs-cn.git","ssh_url":"git@github.com:iT2afL0rd/kubernetes-docs-cn.git","clone_url":"https://github.com/iT2afL0rd/kubernetes-docs-cn.git","svn_url":"https://github.com/iT2afL0rd/kubernetes-docs-cn","homepage":null,"size":33083,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:release-1.1-cn","ref":"release-1.1-cn","sha":"1803b5d8cc0583315cfe1a543c503c71baee2ab5","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":54560544,"name":"kubernetes-docs-cn","full_name":"kubernetes/kubernetes-docs-cn","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes-docs-cn","description":"Chinese-language Kubernetes documentation","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn","forks_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/deployments","created_at":"2016-03-23T13:08:18Z","updated_at":"2016-03-28T04:46:08Z","pushed_at":"2016-03-28T14:40:54Z","git_url":"git://github.com/kubernetes/kubernetes-docs-cn.git","ssh_url":"git@github.com:kubernetes/kubernetes-docs-cn.git","clone_url":"https://github.com/kubernetes/kubernetes-docs-cn.git","svn_url":"https://github.com/kubernetes/kubernetes-docs-cn","homepage":null,"size":33485,"stargazers_count":6,"watchers_count":6,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":13,"forks":8,"open_issues":13,"watchers":6,"default_branch":"release-1.1-cn"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18"},"html":{"href":"https://github.com/kubernetes/kubernetes-docs-cn/pull/18"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues/18"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes-docs-cn/statuses/871ab58f2961d012d452d49b075fe8eb412bd6f9"}}}}