From 68bc931c6569cff4038282c667e24c560f08f744 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Fri, 7 Aug 2015 16:35:28 -0700 Subject: [PATCH] Update the documentation to show that you can get an external IP from kubectl and LoadBalancer services --- docs/user-guide/connecting-applications.md | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/user-guide/connecting-applications.md b/docs/user-guide/connecting-applications.md index 0f9a55e1dfa..caa2ad2ec2b 100644 --- a/docs/user-guide/connecting-applications.md +++ b/docs/user-guide/connecting-applications.md @@ -133,8 +133,9 @@ Check your Service: ```console $ kubectl get svc -NAME LABELS SELECTOR IP(S) PORT(S) -nginxsvc app=nginx app=nginx 10.0.116.146 80/TCP +NAME CLUSTER IP EXTERNAL IP PORT(S) SELECTOR AGE +kubernetes 10.179.240.1 443/TCP 8d +nginxsvc 10.179.252.126 122.222.183.144 80/TCP,81/TCP,82/TCP run=nginx2 11m ``` As mentioned previously, a Service is backed by a group of pods. These pods are exposed through `endpoints`. The Service's selector will be evaluated continuously and the results will be POSTed to an Endpoints object also named `nginxsvc`. When a pod dies, it is automatically removed from the endpoints, and new pods matching the Service’s selector will automatically get added to the endpoints. Check the endpoints, and note that the IPs are the same as the pods created in the first step: @@ -195,9 +196,8 @@ Kubernetes offers a DNS cluster addon Service that uses skydns to automatically ```console $ kubectl get services kube-dns --namespace=kube-system -NAME LABELS SELECTOR IP(S) PORT(S) -kube-dns k8s-app=kube-dns 10.0.0.10 53/UDP - 53/TCP +NAME CLUSTER IP EXTERNAL IP PORT(S) SELECTOR AGE +kube-dns 10.179.240.10 53/UDP,53/TCP k8s-app=kube-dns 8d ``` If it isn’t running, you can [enable it](http://releases.k8s.io/HEAD/cluster/addons/dns/README.md#how-do-i-configure-it). The rest of this section will assume you have a Service with a long lived IP (nginxsvc), and a dns server that has assigned a name to that IP (the kube-dns cluster addon), so you can talk to the Service from any pod in your cluster using standard methods (e.g. gethostbyname). Let’s create another pod to test this: @@ -412,18 +412,17 @@ Lets now recreate the Service to use a cloud load balancer, just change the `Typ ```console $ kubectl delete rc, svc -l app=nginx $ kubectl create -f ./nginx-app.yaml -$ kubectl get svc -o json | grep -i ingress -A 5 - "ingress": [ - { - "ip": "104.197.68.43" - } - ] - } -$ curl https://104.197.68.43 -k +$ kubectl get svc nginxsvc +NAME CLUSTER IP EXTERNAL IP PORT(S) SELECTOR AGE +nginxsvc 10.179.252.126 162.222.184.144 80/TCP,81/TCP,82/TCP run=nginx2 13m + +$ curl https://162.22.184.144 -k ... Welcome to nginx! ``` +You can generally tell the external IP of the service, since it will be the one that doesn't start with a `10.*` + ## What's next? [Learn about more Kubernetes features that will help you run containers reliably in production.](production-pods.md)