Skip to content

Commit 79fb674

Browse files
committed
Fix the service printer to be a single line per service
1 parent 68bc931 commit 79fb674

File tree

19 files changed

+123
-133
lines changed

19 files changed

+123
-133
lines changed

docs/getting-started-guides/docker-multinode/testing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ kubectl expose rc nginx --port=80
6767
This should print:
6868

6969
```console
70-
NAME LABELS SELECTOR IP PORT(S)
71-
nginx <none> run=nginx <ip-addr> 80/TCP
70+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
71+
nginx 10.179.240.1 <none> 80/TCP run=nginx 8d
7272
```
7373

7474
Hit the webserver:

docs/getting-started-guides/docker.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ kubectl expose rc nginx --port=80
151151
This should print:
152152

153153
```console
154-
NAME LABELS SELECTOR IP PORT(S)
155-
nginx run=nginx run=nginx <ip-addr> 80/TCP
154+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
155+
nginx 10.0.93.211 <none> 80/TCP run=nginx 1h
156156
```
157157

158-
If ip-addr is blank run the following command to obtain it. Know issue #10836
158+
If `CLUSTER_IP` is blank run the following command to obtain it. Know issue #10836
159159

160160
```sh
161161
kubectl get svc nginx

docs/getting-started-guides/gce.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,11 @@ $ kubectl get --all-namespaces services
145145
should show a set of [services](../user-guide/services.md) that look something like this:
146146

147147
```console
148-
NAMESPACE NAME LABELS SELECTOR IP(S) PORT(S)
149-
default kubernetes component=apiserver,provider=kubernetes <none> 10.0.0.1 443/TCP
150-
kube-system kube-dns k8s-app=kube-dns,kubernetes.io/cluster-service=true,kubernetes.io/name=KubeDNS k8s-app=kube-dns 10.0.0.10 53/UDP
151-
53/TCP
152-
kube-system kube-ui k8s-app=kube-ui,kubernetes.io/cluster-service=true,kubernetes.io/name=KubeUI k8s-app=kube-ui 10.0.59.25 80/TCP
153-
kube-system monitoring-grafana kubernetes.io/cluster-service=true,kubernetes.io/name=Grafana k8s-app=influxGrafana 10.0.41.246 80/TCP
154-
kube-system monitoring-heapster kubernetes.io/cluster-service=true,kubernetes.io/name=Heapster k8s-app=heapster 10.0.59.48 80/TCP
155-
kube-system monitoring-influxdb kubernetes.io/cluster-service=true,kubernetes.io/name=InfluxDB k8s-app=influxGrafana 10.0.210.156 8083/TCP
156-
8086/TCP
148+
NAMESPACE NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
149+
default kubernetes 10.0.0.1 <none> 443/TCP <none> 1d
150+
kube-system kube-dns 10.0.0.2 <none> 53/TCP,53/UDP k8s-app=kube-dns 1d
151+
kube-system kube-ui 10.0.0.3 <none> 80/TCP k8s-app=kube-ui 1d
152+
... 8086/TCP
157153
```
158154

159155
Similarly, you can take a look at the set of [pods](../user-guide/pods.md) that were created during cluster startup.

docs/getting-started-guides/vagrant.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ $ ./cluster/kubectl.sh get pods
227227
NAME READY STATUS RESTARTS AGE
228228

229229
$ ./cluster/kubectl.sh get services
230-
NAME LABELS SELECTOR IP(S) PORT(S)
230+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
231231

232232
$ ./cluster/kubectl.sh get replicationcontrollers
233233
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
@@ -282,11 +282,8 @@ my-nginx-gr3hh 1/1 Running 0 1m
282282
my-nginx-xql4j 1/1 Running 0 1m
283283

284284
$ ./cluster/kubectl.sh get services
285-
NAME LABELS SELECTOR IP(S) PORT(S)
286-
287-
$ ./cluster/kubectl.sh get replicationcontrollers
288-
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
289-
my-nginx my-nginx nginx run=my-nginx 3
285+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
286+
my-nginx 10.0.0.1 <none> 80/TCP run=my-nginx 1h
290287
```
291288

292289
We did not start any services, hence there are none listed. But we see three replicas displayed properly.

docs/user-guide/connecting-applications.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Check your Service:
133133

134134
```console
135135
$ kubectl get svc
136-
NAME CLUSTER IP EXTERNAL IP PORT(S) SELECTOR AGE
136+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
137137
kubernetes 10.179.240.1 <none> 443/TCP <none> 8d
138138
nginxsvc 10.179.252.126 122.222.183.144 80/TCP,81/TCP,82/TCP run=nginx2 11m
139139
```
@@ -196,7 +196,7 @@ Kubernetes offers a DNS cluster addon Service that uses skydns to automatically
196196

197197
```console
198198
$ kubectl get services kube-dns --namespace=kube-system
199-
NAME CLUSTER IP EXTERNAL IP PORT(S) SELECTOR AGE
199+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
200200
kube-dns 10.179.240.10 <none> 53/UDP,53/TCP k8s-app=kube-dns 8d
201201
```
202202

@@ -413,15 +413,16 @@ Lets now recreate the Service to use a cloud load balancer, just change the `Typ
413413
$ kubectl delete rc, svc -l app=nginx
414414
$ kubectl create -f ./nginx-app.yaml
415415
$ kubectl get svc nginxsvc
416-
NAME CLUSTER IP EXTERNAL IP PORT(S) SELECTOR AGE
416+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
417417
nginxsvc 10.179.252.126 162.222.184.144 80/TCP,81/TCP,82/TCP run=nginx2 13m
418418
419419
$ curl https://162.22.184.144 -k
420420
...
421421
<title>Welcome to nginx!</title>
422422
```
423423

424-
You can generally tell the external IP of the service, since it will be the one that doesn't start with a `10.*`
424+
The IP address in the `EXTERNAL_IP` column is the one that is available on the public internet. The `CLUSTER_IP` is only available inside your
425+
cluster/private cloud network.
425426

426427
## What's next?
427428

docs/user-guide/debugging-services.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,16 @@ walk-through - you can use your own `Service`'s details here.
209209

210210
```console
211211
$ kubectl expose rc hostnames --port=80 --target-port=9376
212-
NAME LABELS SELECTOR IP(S) PORT(S)
213-
hostnames app=hostnames app=hostnames 80/TCP
212+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
213+
hostnames 10.0.0.1 <none> 80/TCP run=hostnames 1h
214214
```
215215

216216
And read it back, just to be sure:
217217

218218
```console
219219
$ kubectl get svc hostnames
220-
NAME LABELS SELECTOR IP(S) PORT(S)
221-
hostnames app=hostnames app=hostnames 10.0.1.175 80/TCP
220+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
221+
hostnames 10.0.0.1 <none> 80/TCP run=hostnames 1h
222222
```
223223

224224
As before, this is the same as if you had started the `Service` with YAML:

docs/user-guide/docker-cli-to-kubectl.md

-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
7474
nginx-app nginx-app nginx run=nginx-app 1
7575
# expose a port through with a service
7676
$ kubectl expose rc nginx-app --port=80 --name=nginx-http
77-
NAME LABELS SELECTOR IP(S) PORT(S)
78-
nginx-http run=nginx-app run=nginx-app 80/TCP
7977
```
8078

8179
With kubectl, we create a [replication controller](replication-controller.md) which will make sure that N pods are running nginx (where N is the number of replicas stated in the spec, which defaults to 1). We also create a [service](services.md) with a selector that matches the replication controller's selector. See the [Quick start](quick-start.md) for more information.

docs/user-guide/persistent-volumes/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ mypod 1/1 Running 0 1h
107107

108108
$ kubectl create -f docs/user-guide/persistent-volumes/simpletest/service.json
109109
$ kubectl get services
110-
NAME LABELS SELECTOR IP(S) PORT(S)
111-
frontendservice <none> name=frontendhttp 10.0.0.241 3000/TCP
112-
kubernetes component=apiserver,provider=kubernetes <none> 10.0.0.2 443/TCP
110+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
111+
frontendservice 10.0.0.241 <none> 3000/TCP name=frontendhttp 1d
112+
kubernetes 10.0.0.2 <none> 443/TCP <none> 2d
113113
```
114114

115115
## Next steps

docs/user-guide/quick-start.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,20 @@ Through integration with some cloud providers (for example Google Compute Engine
7676

7777
```console
7878
$ kubectl expose rc my-nginx --port=80 --type=LoadBalancer
79-
NAME LABELS SELECTOR IP(S) PORT(S)
80-
my-nginx run=my-nginx run=my-nginx 80/TCP
79+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
80+
my-nginx 10.179.240.1 <none> 80/TCP run=nginx 8d
8181
```
8282

8383
To find the public IP address assigned to your application, execute:
8484

8585
```console
86-
$ kubectl get svc my-nginx -o json | grep \"ip\"
87-
"ip": "130.111.122.213"
86+
$ kubectl get svc my-nginx
87+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
88+
my-nginx 10.179.240.1 25.1.2.3 80/TCP run=nginx 8d
8889
```
8990

91+
You may need to wait for a minute or two for the external ip address to be provisioned.
92+
9093
In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a [firewall to allow traffic on port 80](services-firewalls.md).
9194

9295
## Killing the application

examples/cluster-dns/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ Once that's up you can list the service in the cluster:
113113

114114
```sh
115115
$ kubectl get service dns-backend
116-
NAME LABELS SELECTOR IP(S) PORT(S)
117-
dns-backend <none> name=dns-backend 10.0.236.129 8000/TCP
116+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
117+
dns-backend 10.0.2.3 <none> 8000/TCP name=dns-backend 1d
118118
```
119119

120120
Again, repeat the same process for prod namespace:
@@ -123,8 +123,8 @@ Again, repeat the same process for prod namespace:
123123
$ kubectl config use-context prod
124124
$ kubectl create -f examples/cluster-dns/dns-backend-service.yaml
125125
$ kubectl get service dns-backend
126-
NAME LABELS SELECTOR IP(S) PORT(S)
127-
dns-backend <none> name=dns-backend 10.0.35.246 8000/TCP
126+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
127+
dns-backend 10.0.2.4 <none> 8000/TCP name=dns-backend 1d
128128
```
129129

130130
### Step Four: Create client pod in one namespace

examples/guestbook-go/README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ Services find the containers to load balance based on pod labels. The pod that y
117117

118118
```console
119119
$ kubectl get services
120-
NAME LABELS SELECTOR IP(S) PORT(S)
121-
redis-master app=redis,role=master app=redis,role=master 10.0.136.3 6379/TCP
120+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
121+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
122122
...
123123
```
124124

@@ -183,9 +183,9 @@ Just like the master, we want to have a service to proxy connections to the read
183183

184184
```console
185185
$ kubectl get services
186-
NAME LABELS SELECTOR IP(S) PORT(S)
187-
redis-master app=redis,role=master app=redis,role=master 10.0.136.3 6379/TCP
188-
redis-slave app=redis,role=slave app=redis,role=slave 10.0.21.92 6379/TCP
186+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
187+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
188+
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
189189
...
190190
```
191191

@@ -246,11 +246,10 @@ Just like the others, we create a service to group the guestbook pods but this t
246246

247247
```
248248
$ kubectl get services
249-
NAME LABELS SELECTOR IP(S) PORT(S)
250-
guestbook app=guestbook app=guestbook 10.0.217.218 3000/TCP
251-
146.148.81.8
252-
redis-master app=redis,role=master app=redis,role=master 10.0.136.3 6379/TCP
253-
redis-slave app=redis,role=slave app=redis,role=slave 10.0.21.92 6379/TCP
249+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
250+
guestbook 10.0.217.218 146.148.81.8 3000/TCP app=guestbook 1h
251+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
252+
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
254253
...
255254
```
256255

examples/guestbook/README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ Then check the list of services, which should include the redis-master:
235235

236236
```console
237237
$ kubectl get services
238-
NAME LABELS SELECTOR IP PORT
239-
redis-master name=redis-master name=redis-master 10.0.246.242 6379
238+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
239+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
240+
...
240241
```
241242

242243
This will cause all pods to see the redis master apparently running on <ip>:6379. A service can map an incoming port to any `targetPort` in the backend pod. Once created, the service proxy on each node is configured to set up a proxy on the specified port (in this case port 6379).
@@ -358,9 +359,9 @@ $ kubectl create -f examples/guestbook/redis-slave-service.yaml
358359
services/redis-slave
359360
360361
$ kubectl get services
361-
NAME LABELS SELECTOR IP PORT
362-
redis-master name=redis-master name=redis-master 10.0.246.242 6379
363-
redis-slave name=redis-slave name=redis-slave 10.0.72.62 6379
362+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
363+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
364+
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
364365
```
365366

366367
### Step Five: Create the frontend replicated pods
@@ -525,10 +526,10 @@ Then, list all your services again:
525526

526527
```console
527528
$ kubectl get services
528-
NAME LABELS SELECTOR IP PORT(S)
529-
frontend name=frontend name=frontend 10.0.93.211 80/TCP
530-
redis-master name=redis-master name=redis-master 10.0.246.242 6379/TCP
531-
redis-slave name=redis-slave name=redis-slave 10.0.72.62 6379/TCP
529+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
530+
frontend 10.0.93.211 <none> 80/TCP name=frontend 1h
531+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
532+
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
532533
```
533534

534535

@@ -544,11 +545,10 @@ If the `LoadBalancer` specification is used, it can take a short period for an e
544545

545546
```console
546547
$ kubectl get services
547-
NAME LABELS SELECTOR IP PORT(S)
548-
frontend name=frontend name=frontend 10.0.93.211 80/TCP
549-
130.211.135.84
550-
redis-master name=redis-master name=redis-master 10.0.246.242 6379/TCP
551-
redis-slave name=redis-slave name=redis-slave 10.0.72.62 6379/TCP
548+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
549+
frontend 10.0.93.211 130.211.188.51 80/TCP name=frontend 1h
550+
redis-master 10.0.136.3 <none> 6379/TCP app=redis,role=master 1h
551+
redis-slave 10.0.21.92 <none> 6379/TCP app-redis,role=slave 1h
552552
```
553553

554554
Once you've exposed the service to an external IP, visit the IP to see your guestbook in action. E.g., `http://130.211.188.51:80` in the example above.

examples/mysql-wordpress-pd/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ $ kubectl get services
302302

303303
Then, find the external IP for your WordPress service by running:
304304

305-
```
306-
$ kubectl get services/wpfrontend --template="{{range .status.loadBalancer.ingress}} {{.ip}} {{end}}"
305+
```console
306+
$ kubectl get services/wpfrontend
307+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
308+
wpfrontend 10.0.0.2 1.2.3.4 80/TCP ... ...
307309
```
308310

309311
or by listing the forwarding rules for your project:

examples/phabricator/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,12 @@ $ kubectl create -f examples/phabricator/phabricator-service.json
247247
phabricator
248248
```
249249

250-
To play with the service itself, find the external IP of the load balancer:
250+
To play with the service itself, find the `EXTERNAL_IP` of the load balancer:
251251

252-
```sh
253-
$ kubectl get services phabricator -o template --template='{{(index .status.loadBalancer.ingress 0).ip}}{{"\n"}}'
252+
```console
253+
$ kubectl get services phabricator
254+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
255+
phabricator 10.0.0.2 1.2.3.4 8080/TCP ... ...
254256
```
255257

256258
and then visit port 80 of that IP address.

examples/rethinkdb/README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ check out:
5656

5757
```sh
5858
$kubectl get services
59-
NAME LABELS SELECTOR IP(S) PORT(S)
59+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
60+
rethinkdb-driver 10.0.27.114 <none> 28015/TCP db=rethinkdb 10m
6061
[...]
61-
rethinkdb-driver db=influxdb db=rethinkdb 10.0.27.114 28015/TCP
6262
```
6363

6464
**Step 2**
@@ -115,13 +115,12 @@ kubectl create -f examples/rethinkdb/admin-service.yaml
115115

116116
find the service
117117

118-
```sh
118+
```console
119119
$kubectl get services
120-
NAME LABELS SELECTOR IP(S) PORT(S)
120+
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
121121
[...]
122-
rethinkdb-admin db=influxdb db=rethinkdb,role=admin 10.0.131.19 8080/TCP
123-
104.197.19.120
124-
rethinkdb-driver db=influxdb db=rethinkdb 10.0.27.114 28015/TCP
122+
rethinkdb-admin 10.0.131.19 104.197.19.120 8080/TCP db=rethinkdb,role=admin 10m
123+
rethinkdb-driver 10.0.27.114 <none> 28015/TCP db=rethinkdb 20m
125124
```
126125

127126
We request an external load balancer in the [admin-service.yaml](admin-service.yaml) file:

0 commit comments

Comments
 (0)