{"action":"created","comment":{"url":"https://api.github.com/repos/gardener/documentation/pulls/comments/214716178","pull_request_review_id":151828350,"id":214716178,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDcxNjE3OA==","diff_hunk":"@@ -0,0 +1,403 @@\n+---\n+title: Access my service from outside Kubernetes cluster\n+description: \"Is there an ingress deployed and how is it configured\"\n+type: tutorial-page\n+level: beginner\n+index: 150\n+reviewer: Tieyan Fu\n+status: Reviewed\n+last_reviewed: 07.06.2018\n+category: Services\n+scope: app-developer\n+---\n+\n+## TL;DR\n+To expose your application / service for access from outside the cluster, following options exist:\n+- Kubernetes Service of type `LoadBalancer`\n+- Kubernetes Service of type 'NodePort' + Ingress\n+\n+\n+\n+This tutorial discusses how to enable access to your application from outside Kubernetes cluster (sometimes called \n+North-South traffic).   For internal communication amongst pods and services (sometimes called East-West traffic) there \n+are many literatures, [here](https://cloudnativelabs.github.io/post/2017-04-18-kubernetes-networking/) is one brief example.\n+\n+## Service Types\n+A Service in Kubernetes is an abstraction which defines a logical set of Pods and a policy by which to access them.  \n+Services can be exposed in different ways by specifying a **type** in the service spec,\n+and different types determine accessibility from inside and outside of cluster.\n+- ClusterIP\n+- NodePort\n+- LoadBalancer\n+\n+Type `ExternalName` is a special case of service and not discussed here.\n+\n+\n+### Type ClusterIP\n+A service of type `ClusterIP` exposes service on an internal IP in the cluster, which makes the service **only reachable** \n+from within the cluster.  This is the default value if no type is specified.\n+\n+```yaml\n+apiVersion: apps/v1beta2\n+kind: Deployment\n+metadata:\n+  name: nginx-deployment\n+spec:\n+  selector:\n+    matchLabels:\n+      app: nginx-app\n+  replicas: 1\n+  template:\n+    metadata:\n+      labels:\n+        app: nginx-app\n+    spec:\n+      containers:\n+      - name: nginx\n+        image: nginx:1.13.12\n+        ports:\n+        - containerPort: 80\n+---\n+apiVersion: v1\n+kind: Service\n+metadata:\n+  labels:\n+    app: nginx-app\n+  name: nginx-svc\n+  namespace: default\n+spec:\n+  type: ClusterIP  # use ClusterIP as type here\n+  ports:\n+    - port: 80\n+  selector:\n+    app: nginx-app\n+```\n+\n+\n+Execute following commands to create deployement and service\n+\n+```shell\n+kubectl create -f <Your yaml file name>\n+```\n+\n+Checking the service status\n+```shell\n+$ kubectl get svc nginx-svc\n+NAME        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE\n+nginx-svc   ClusterIP   100.66.125.61   <none>        80/TCP    45m\n+```\n+\n+As shown above, the service is assigned with a cluster ip address and port 80 as defined in yaml file.    You can test \n+the service as below:\n+\n+```shell\n+\n+# list all existing pods in cluster\n+$ kubectl get po\n+NAME                                           READY     STATUS        RESTARTS   AGE\n+docker-nodejs-app-76b77494-vwv4d               1/1       Running       0          11d\n+nginx-deployment-74d949bf69-nvdzs              1/1       Running       0          1h\n+privileged-pod                                 1/1       Running       0          11d\n+\n+# test service from within the cluster on the same pod\n+$ kubectl exec -it nginx-deployment-74d949bf69-nvdzs  curl 100.66.125.61:80\n+  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n+                                 Dload  Upload   Total   Spent    Left  Speed\n+100   612  100   612    0     0  1006k      0 --:--:-- --:--:-- --:--:--  597k\n+<!DOCTYPE html>\n+<html>\n+<head>\n+<title>Welcome to nginx!</title>\n+<style>\n+    body {\n+        width: 35em;\n+        margin: 0 auto;\n+        font-family: Tahoma, Verdana, Arial, sans-serif;\n+    }\n+</style>\n+</head>\n+<body>\n+<h1>Welcome to nginx!</h1>\n+<p>If you see this page, the nginx web server is successfully installed and\n+working. Further configuration is required.</p>\n+...\n+```\n+\n+>  <i class=\"fa fa-gittip\" aria-hidden=\"true\"></i> Tip\n+> - The service is also accessible from any container (even on different pod) within the same cluster, e.g. `kubectl -it exec <another POD_NAME> curl <YourServiceClusterIP:YourPort>`.\n+>   You need to make sure command `curl` is installed in the container.\n+> - You can also find out the dns name of the ClusterIP by command `kubectl exec -it <POD_NAME> nslookup <ClusterIP>`, \n+then replace the IP address with the resolved name in your test.\n+> The resolved name typically looks like `nginx-svc.default.svc.cluster.local` where `nginx-svc` is the name of your \n+service defined in yaml.","path":"hugo/content/050-tutorials/content/howto/service-access/_index.md","position":null,"original_position":132,"commit_id":"ebf9381c18740dd37af60e4576429d3886c39bf5","original_commit_id":"f5e5105cd3db2a3c1df7135d89045d3fac7b7b8c","user":{"login":"freegroup","id":1155039,"node_id":"MDQ6VXNlcjExNTUwMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/1155039?v=4","gravatar_id":"","url":"https://api.github.com/users/freegroup","html_url":"https://github.com/freegroup","followers_url":"https://api.github.com/users/freegroup/followers","following_url":"https://api.github.com/users/freegroup/following{/other_user}","gists_url":"https://api.github.com/users/freegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/freegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freegroup/subscriptions","organizations_url":"https://api.github.com/users/freegroup/orgs","repos_url":"https://api.github.com/users/freegroup/repos","events_url":"https://api.github.com/users/freegroup/events{/privacy}","received_events_url":"https://api.github.com/users/freegroup/received_events","type":"User","site_admin":false},"body":"ebf9381c18740dd37af60e4576429d3886c39bf5","created_at":"2018-09-03T15:04:26Z","updated_at":"2018-09-03T15:04:26Z","html_url":"https://github.com/gardener/documentation/pull/21#discussion_r214716178","pull_request_url":"https://api.github.com/repos/gardener/documentation/pulls/21","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gardener/documentation/pulls/comments/214716178"},"html":{"href":"https://github.com/gardener/documentation/pull/21#discussion_r214716178"},"pull_request":{"href":"https://api.github.com/repos/gardener/documentation/pulls/21"}},"in_reply_to_id":210519770},"pull_request":{"url":"https://api.github.com/repos/gardener/documentation/pulls/21","id":207292723,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MjkyNzIz","html_url":"https://github.com/gardener/documentation/pull/21","diff_url":"https://github.com/gardener/documentation/pull/21.diff","patch_url":"https://github.com/gardener/documentation/pull/21.patch","issue_url":"https://api.github.com/repos/gardener/documentation/issues/21","number":21,"state":"open","locked":false,"title":"refactor the old landingpage to the new site generation tool \"Hugo\". …","user":{"login":"freegroup","id":1155039,"node_id":"MDQ6VXNlcjExNTUwMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/1155039?v=4","gravatar_id":"","url":"https://api.github.com/users/freegroup","html_url":"https://github.com/freegroup","followers_url":"https://api.github.com/users/freegroup/followers","following_url":"https://api.github.com/users/freegroup/following{/other_user}","gists_url":"https://api.github.com/users/freegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/freegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freegroup/subscriptions","organizations_url":"https://api.github.com/users/freegroup/orgs","repos_url":"https://api.github.com/users/freegroup/repos","events_url":"https://api.github.com/users/freegroup/events{/privacy}","received_events_url":"https://api.github.com/users/freegroup/received_events","type":"User","site_admin":false},"body":"…Add tutorials, components of the gardeneer and foreign links to gardener related pages","created_at":"2018-08-09T12:01:34Z","updated_at":"2018-09-03T15:04:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52fd6f34a260bfcf5249dc8e476760ebb919331a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gardener/documentation/pulls/21/commits","review_comments_url":"https://api.github.com/repos/gardener/documentation/pulls/21/comments","review_comment_url":"https://api.github.com/repos/gardener/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gardener/documentation/issues/21/comments","statuses_url":"https://api.github.com/repos/gardener/documentation/statuses/ebf9381c18740dd37af60e4576429d3886c39bf5","head":{"label":"freegroup:master","ref":"master","sha":"ebf9381c18740dd37af60e4576429d3886c39bf5","user":{"login":"freegroup","id":1155039,"node_id":"MDQ6VXNlcjExNTUwMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/1155039?v=4","gravatar_id":"","url":"https://api.github.com/users/freegroup","html_url":"https://github.com/freegroup","followers_url":"https://api.github.com/users/freegroup/followers","following_url":"https://api.github.com/users/freegroup/following{/other_user}","gists_url":"https://api.github.com/users/freegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/freegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freegroup/subscriptions","organizations_url":"https://api.github.com/users/freegroup/orgs","repos_url":"https://api.github.com/users/freegroup/repos","events_url":"https://api.github.com/users/freegroup/events{/privacy}","received_events_url":"https://api.github.com/users/freegroup/received_events","type":"User","site_admin":false},"repo":{"id":144144629,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQxNDQ2Mjk=","name":"documentation","full_name":"freegroup/documentation","owner":{"login":"freegroup","id":1155039,"node_id":"MDQ6VXNlcjExNTUwMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/1155039?v=4","gravatar_id":"","url":"https://api.github.com/users/freegroup","html_url":"https://github.com/freegroup","followers_url":"https://api.github.com/users/freegroup/followers","following_url":"https://api.github.com/users/freegroup/following{/other_user}","gists_url":"https://api.github.com/users/freegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/freegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freegroup/subscriptions","organizations_url":"https://api.github.com/users/freegroup/orgs","repos_url":"https://api.github.com/users/freegroup/repos","events_url":"https://api.github.com/users/freegroup/events{/privacy}","received_events_url":"https://api.github.com/users/freegroup/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/freegroup/documentation","description":"Documentation and website","fork":true,"url":"https://api.github.com/repos/freegroup/documentation","forks_url":"https://api.github.com/repos/freegroup/documentation/forks","keys_url":"https://api.github.com/repos/freegroup/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/freegroup/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/freegroup/documentation/teams","hooks_url":"https://api.github.com/repos/freegroup/documentation/hooks","issue_events_url":"https://api.github.com/repos/freegroup/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/freegroup/documentation/events","assignees_url":"https://api.github.com/repos/freegroup/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/freegroup/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/freegroup/documentation/tags","blobs_url":"https://api.github.com/repos/freegroup/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/freegroup/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/freegroup/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/freegroup/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/freegroup/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/freegroup/documentation/languages","stargazers_url":"https://api.github.com/repos/freegroup/documentation/stargazers","contributors_url":"https://api.github.com/repos/freegroup/documentation/contributors","subscribers_url":"https://api.github.com/repos/freegroup/documentation/subscribers","subscription_url":"https://api.github.com/repos/freegroup/documentation/subscription","commits_url":"https://api.github.com/repos/freegroup/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/freegroup/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/freegroup/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/freegroup/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/freegroup/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/freegroup/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/freegroup/documentation/merges","archive_url":"https://api.github.com/repos/freegroup/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/freegroup/documentation/downloads","issues_url":"https://api.github.com/repos/freegroup/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/freegroup/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/freegroup/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/freegroup/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/freegroup/documentation/labels{/name}","releases_url":"https://api.github.com/repos/freegroup/documentation/releases{/id}","deployments_url":"https://api.github.com/repos/freegroup/documentation/deployments","created_at":"2018-08-09T11:39:41Z","updated_at":"2018-09-03T15:02:14Z","pushed_at":"2018-09-03T15:02:09Z","git_url":"git://github.com/freegroup/documentation.git","ssh_url":"git@github.com:freegroup/documentation.git","clone_url":"https://github.com/freegroup/documentation.git","svn_url":"https://github.com/freegroup/documentation","homepage":"","size":26251,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gardener:master","ref":"master","sha":"22a04eba3413ec5b31d48074699b488e602d3469","user":{"login":"gardener","id":33683699,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzNjgzNjk5","avatar_url":"https://avatars2.githubusercontent.com/u/33683699?v=4","gravatar_id":"","url":"https://api.github.com/users/gardener","html_url":"https://github.com/gardener","followers_url":"https://api.github.com/users/gardener/followers","following_url":"https://api.github.com/users/gardener/following{/other_user}","gists_url":"https://api.github.com/users/gardener/gists{/gist_id}","starred_url":"https://api.github.com/users/gardener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardener/subscriptions","organizations_url":"https://api.github.com/users/gardener/orgs","repos_url":"https://api.github.com/users/gardener/repos","events_url":"https://api.github.com/users/gardener/events{/privacy}","received_events_url":"https://api.github.com/users/gardener/received_events","type":"Organization","site_admin":false},"repo":{"id":113030845,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMwMzA4NDU=","name":"documentation","full_name":"gardener/documentation","owner":{"login":"gardener","id":33683699,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzNjgzNjk5","avatar_url":"https://avatars2.githubusercontent.com/u/33683699?v=4","gravatar_id":"","url":"https://api.github.com/users/gardener","html_url":"https://github.com/gardener","followers_url":"https://api.github.com/users/gardener/followers","following_url":"https://api.github.com/users/gardener/following{/other_user}","gists_url":"https://api.github.com/users/gardener/gists{/gist_id}","starred_url":"https://api.github.com/users/gardener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardener/subscriptions","organizations_url":"https://api.github.com/users/gardener/orgs","repos_url":"https://api.github.com/users/gardener/repos","events_url":"https://api.github.com/users/gardener/events{/privacy}","received_events_url":"https://api.github.com/users/gardener/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gardener/documentation","description":"Documentation and website","fork":false,"url":"https://api.github.com/repos/gardener/documentation","forks_url":"https://api.github.com/repos/gardener/documentation/forks","keys_url":"https://api.github.com/repos/gardener/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gardener/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gardener/documentation/teams","hooks_url":"https://api.github.com/repos/gardener/documentation/hooks","issue_events_url":"https://api.github.com/repos/gardener/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/gardener/documentation/events","assignees_url":"https://api.github.com/repos/gardener/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/gardener/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/gardener/documentation/tags","blobs_url":"https://api.github.com/repos/gardener/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gardener/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gardener/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/gardener/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gardener/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/gardener/documentation/languages","stargazers_url":"https://api.github.com/repos/gardener/documentation/stargazers","contributors_url":"https://api.github.com/repos/gardener/documentation/contributors","subscribers_url":"https://api.github.com/repos/gardener/documentation/subscribers","subscription_url":"https://api.github.com/repos/gardener/documentation/subscription","commits_url":"https://api.github.com/repos/gardener/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/gardener/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/gardener/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/gardener/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/gardener/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/gardener/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gardener/documentation/merges","archive_url":"https://api.github.com/repos/gardener/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gardener/documentation/downloads","issues_url":"https://api.github.com/repos/gardener/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/gardener/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/gardener/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/gardener/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gardener/documentation/labels{/name}","releases_url":"https://api.github.com/repos/gardener/documentation/releases{/id}","deployments_url":"https://api.github.com/repos/gardener/documentation/deployments","created_at":"2017-12-04T10:49:55Z","updated_at":"2018-08-11T07:43:07Z","pushed_at":"2018-09-03T15:02:13Z","git_url":"git://github.com/gardener/documentation.git","ssh_url":"git@github.com:gardener/documentation.git","clone_url":"https://github.com/gardener/documentation.git","svn_url":"https://github.com/gardener/documentation","homepage":"","size":4169,"stargazers_count":9,"watchers_count":9,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4,"open_issues":4,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gardener/documentation/pulls/21"},"html":{"href":"https://github.com/gardener/documentation/pull/21"},"issue":{"href":"https://api.github.com/repos/gardener/documentation/issues/21"},"comments":{"href":"https://api.github.com/repos/gardener/documentation/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/gardener/documentation/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/gardener/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gardener/documentation/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/gardener/documentation/statuses/ebf9381c18740dd37af60e4576429d3886c39bf5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"freegroup"}}