2015-07-12 04:04:52 +00:00
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- BEGIN STRIP_FOR_RELEASE -->
2015-07-16 17:02:26 +00:00
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< h2 > PLEASE NOTE: This document applies to the HEAD of the source tree< / h2 >
If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.
< strong >
The latest 1.0.x release of this document can be found
[here ](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode/testing.md ).
Documentation for other releases can be found at
[releases.k8s.io ](http://releases.k8s.io ).
< / strong >
--
2015-07-13 22:15:35 +00:00
2015-07-12 04:04:52 +00:00
<!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
2015-07-17 22:35:41 +00:00
2015-04-07 04:47:04 +00:00
## Testing your Kubernetes cluster.
To validate that your node(s) have been added, run:
```sh
kubectl get nodes
```
That should show something like:
2015-07-17 02:01:02 +00:00
2015-04-07 04:47:04 +00:00
```
2015-06-15 02:38:50 +00:00
NAME LABELS STATUS
10.240.99.26 kubernetes.io/hostname=10.240.99.26 Ready
127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready
2015-04-07 04:47:04 +00:00
```
If the status of any node is ```Unknown``` or ```NotReady``` your cluster is broken, double check that all containers are running properly, and if all else fails, contact us on IRC at
2015-07-16 00:28:59 +00:00
[```#google-containers``` ](http://webchat.freenode.net/?channels=google-containers ) for advice.
2015-04-07 04:47:04 +00:00
### Run an application
2015-07-17 02:01:02 +00:00
2015-04-07 04:47:04 +00:00
```sh
2015-05-21 20:53:10 +00:00
kubectl -s http://localhost:8080 run nginx --image=nginx --port=80
2015-04-07 04:47:04 +00:00
```
now run ```docker ps``` you should see nginx running. You may need to wait a few minutes for the image to get pulled.
2015-07-13 18:11:34 +00:00
### Expose it as a service
2015-07-17 02:01:02 +00:00
2015-04-07 04:47:04 +00:00
```sh
kubectl expose rc nginx --port=80
```
This should print:
2015-07-17 02:01:02 +00:00
2015-04-07 04:47:04 +00:00
```
NAME LABELS SELECTOR IP PORT(S)
2015-05-21 20:53:10 +00:00
nginx < none > run=nginx < ip-addr > 80/TCP
2015-04-07 04:47:04 +00:00
```
Hit the webserver:
2015-07-17 02:01:02 +00:00
2015-04-07 04:47:04 +00:00
```sh
curl < insert-ip-from-above-here >
```
Note that you will need run this curl command on your boot2docker VM if you are running on OS X.
### Scaling
Now try to scale up the nginx you created before:
```sh
2015-05-21 21:10:25 +00:00
kubectl scale rc nginx --replicas=3
2015-04-07 04:47:04 +00:00
```
And list the pods
```sh
kubectl get pods
```
2015-05-14 22:12:45 +00:00
You should see pods landing on the newly added machine.
2015-07-14 00:13:09 +00:00
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
2015-05-14 22:12:45 +00:00
[![Analytics ](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker-multinode/testing.md?pixel )]()
2015-07-14 00:13:09 +00:00
<!-- END MUNGE: GENERATED_ANALYTICS -->