github.com/enmand/kubernetes@v1.2.0-alpha.0/docs/getting-started-guides/docker-multinode/testing.md (about) 1 <!-- BEGIN MUNGE: UNVERSIONED_WARNING --> 2 3 <!-- BEGIN STRIP_FOR_RELEASE --> 4 5 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 6 width="25" height="25"> 7 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 8 width="25" height="25"> 9 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 10 width="25" height="25"> 11 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 12 width="25" height="25"> 13 <img src="http://kubernetes.io/img/warning.png" alt="WARNING" 14 width="25" height="25"> 15 16 <h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2> 17 18 If you are using a released version of Kubernetes, you should 19 refer to the docs that go with that version. 20 21 <strong> 22 The latest 1.0.x release of this document can be found 23 [here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode/testing.md). 24 25 Documentation for other releases can be found at 26 [releases.k8s.io](http://releases.k8s.io). 27 </strong> 28 -- 29 30 <!-- END STRIP_FOR_RELEASE --> 31 32 <!-- END MUNGE: UNVERSIONED_WARNING --> 33 34 ## Testing your Kubernetes cluster. 35 36 To validate that your node(s) have been added, run: 37 38 ```sh 39 kubectl get nodes 40 ``` 41 42 That should show something like: 43 44 ```console 45 NAME LABELS STATUS 46 10.240.99.26 kubernetes.io/hostname=10.240.99.26 Ready 47 127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready 48 ``` 49 50 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 [Slack](../../troubleshooting.md#slack). 51 52 ### Run an application 53 54 ```sh 55 kubectl -s http://localhost:8080 run nginx --image=nginx --port=80 56 ``` 57 58 now run `docker ps` you should see nginx running. You may need to wait a few minutes for the image to get pulled. 59 60 ### Expose it as a service 61 62 ```sh 63 kubectl expose rc nginx --port=80 64 ``` 65 66 This should print: 67 68 ```console 69 NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE 70 nginx 10.179.240.1 <none> 80/TCP run=nginx 8d 71 ``` 72 73 Hit the webserver: 74 75 ```sh 76 curl <insert-ip-from-above-here> 77 ``` 78 79 Note that you will need run this curl command on your boot2docker VM if you are running on OS X. 80 81 ### Scaling 82 83 Now try to scale up the nginx you created before: 84 85 ```sh 86 kubectl scale rc nginx --replicas=3 87 ``` 88 89 And list the pods 90 91 ```sh 92 kubectl get pods 93 ``` 94 95 You should see pods landing on the newly added machine. 96 97 98 <!-- BEGIN MUNGE: GENERATED_ANALYTICS --> 99 []() 100 <!-- END MUNGE: GENERATED_ANALYTICS -->