diff --git a/docs/design/simple-rolling-update.md b/docs/design/simple-rolling-update.md index 43b086ae8a9..2d2bd8265f5 100644 --- a/docs/design/simple-rolling-update.md +++ b/docs/design/simple-rolling-update.md @@ -57,7 +57,6 @@ then ```foo-next``` is synthesized using the pattern ```- ``` -Also setup your path to point to the released binaries: -``` -export PATH=$PATH:$PWD:/kubernetes/cluster -``` - -If you run into trouble come ask questions on IRC at #google-containers on freenode. - - -### Running a container (simple version) - -Once you have your cluster created you can use ```${SOME_DIR}/kubernetes/cluster/kubectl.sh``` to access -the kubernetes api. - -The `kubectl.sh` line below spins up two containers running -[Nginx](http://nginx.org/en/) running on port 80: +Copy the appropriate ```kubectl``` binary to somewhere in your ```PATH```, for example: ```bash -cluster/kubectl.sh run-container my-nginx --image=nginx --replicas=2 --port=80 +# OS X +sudo cp kubernetes/platforms/darwin/amd64/kubectl /usr/local/bin/kubectl + +# Linux +sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl ``` -To stop the containers: -```bash -cluster/kubectl.sh stop rc my-nginx -``` +### Getting started with your cluster +See [a simple nginx example](../../examples/simple-nginx.md) to try out your new cluster. -To delete the containers: - -```bash -cluster/kubectl.sh delete rc my-nginx -``` - -### Running a container (more complete version) - -```bash -cd kubernetes -cluster/kubectl.sh create -f docs/getting-started-guides/pod.json -``` - -Where pod.json contains something like: - -```json -{ - "id": "php", - "kind": "Pod", - "apiVersion": "v1beta1", - "desiredState": { - "manifest": { - "version": "v1beta1", - "id": "php", - "containers": [{ - "name": "nginx", - "image": "nginx", - "ports": [{ - "containerPort": 80, - "hostPort": 8081 - }], - "livenessProbe": { - "enabled": true, - "type": "http", - "initialDelaySeconds": 30, - "httpGet": { - "path": "/index.html", - "port": 8081 - } - } - }] - } - }, - "labels": { - "name": "foo" - } -} -``` - -You can see your cluster's pods: - -```bash -cluster/kubectl.sh get pods -``` - -and delete the pod you just created: - -```bash -cluster/kubectl.sh delete pods php -``` - -Since this pod is scheduled on a minion running in AWS, you will have to enable incoming tcp traffic via the port specified in the -pod manifest before you see the nginx welcome page. After doing so, it should be visible at http://:. - -Look in `examples/` for more examples +For more complete applications, please look in the [examples directory](../../examples) ### Tearing down the cluster ```bash diff --git a/docs/getting-started-guides/docker-multinode.md b/docs/getting-started-guides/docker-multinode.md index c2fe5568aaa..a7f4b02b0cc 100644 --- a/docs/getting-started-guides/docker-multinode.md +++ b/docs/getting-started-guides/docker-multinode.md @@ -40,4 +40,6 @@ See [here](docker-multinode/worker.md) for detailed instructions. ## Testing your cluster -Once your cluster has been created you can [test it out](docker-multinode/testing.md) \ No newline at end of file +Once your cluster has been created you can [test it out](docker-multinode/testing.md) + +For more complete applications, please look in the [examples directory](../../examples) diff --git a/docs/getting-started-guides/gce.md b/docs/getting-started-guides/gce.md index c91aa129f13..22e0167bd85 100644 --- a/docs/getting-started-guides/gce.md +++ b/docs/getting-started-guides/gce.md @@ -33,99 +33,24 @@ wget -q -O - https://get.k8s.io | bash This will leave you with a ```kubernetes``` directory on your workstation, and a running cluster. -Feel free to move the ```kubernetes``` directory to the appropriate directory on your workstation (e.g. ```/opt/kubernetes```) then ```cd``` into that directory: +Copy the appropriate ```kubectl``` binary to somewhere in your ```PATH```, for example: ```bash -mv kubernetes ${SOME_DIR}/kubernetes -cd ${SOME_DIR}/kubernetes +# OS X +sudo cp kubernetes/platforms/darwin/amd64/kubectl /usr/local/bin/kubectl + +# Linux +sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl ``` If you run into trouble please see the section on [troubleshooting](https://github.com/brendandburns/kubernetes/blob/docs/docs/getting-started-guides/gce.md#troubleshooting), or come ask questions on IRC at #google-containers on freenode. -### Running a container (simple version) +### Getting started with your cluster +See [a simple nginx example](../../examples/simple-nginx.md) to try out your new cluster. -Once you have your cluster created you can use ```${SOME_DIR}/kubernetes/cluster/kubectl.sh``` to access -the kubernetes api. +For more complete applications, please look in the [examples directory](../../examples) -The `kubectl.sh` line below spins up two containers running -[Nginx](http://nginx.org/en/) running on port 80: - -```bash -cluster/kubectl.sh run-container my-nginx --image=nginx --replicas=2 --port=80 -``` - -To stop the containers: - -```bash -cluster/kubectl.sh stop rc my-nginx -``` - -To delete the containers: - -```bash -cluster/kubectl.sh delete rc my-nginx -``` - -### Running a container (more complete version) - -```bash -cd kubernetes -cluster/kubectl.sh create -f docs/getting-started-guides/pod.json -``` - -Where pod.json contains something like: - -```json -{ - "id": "php", - "kind": "Pod", - "apiVersion": "v1beta1", - "desiredState": { - "manifest": { - "version": "v1beta1", - "id": "php", - "containers": [{ - "name": "nginx", - "image": "nginx", - "ports": [{ - "containerPort": 80, - "hostPort": 8081 - }], - "livenessProbe": { - "enabled": true, - "type": "http", - "initialDelaySeconds": 30, - "httpGet": { - "path": "/index.html", - "port": 8081 - } - } - }] - } - }, - "labels": { - "name": "foo" - } -} -``` - -You can see your cluster's pods: - -```bash -cluster/kubectl.sh get pods -``` - -and delete the pod you just created: - -```bash -cluster/kubectl.sh delete pods php -``` - -Since this pod is scheduled on a minion running in GCE, you will have to enable incoming tcp traffic via the port specified in the -pod manifest before you see the nginx welcome page. After doing so, it should be visible at http://:. - -Look in `examples/` for more examples ### Tearing down the cluster diff --git a/docs/getting-started-guides/pod.json b/docs/getting-started-guides/pod.json deleted file mode 100644 index 296fedad862..00000000000 --- a/docs/getting-started-guides/pod.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "kind": "Pod", - "apiVersion": "v1beta1", - "id": "php", - "desiredState": { - "manifest": { - "version": "v1beta1", - "id": "php", - "containers": [{ - "name": "nginx", - "image": "nginx", - "ports": [{ - "containerPort": 80, - "hostPort": 8081 - }], - "livenessProbe": { - "enabled": true, - "type": "http", - "initialDelaySeconds": 30, - "httpGet": { - "path": "/", - "port": "80" - } - } - }] - } - }, - "labels": { - "name": "foo" - } -} - diff --git a/examples/examples_test.go b/examples/examples_test.go index 19d2d1ec139..e4ebd42f322 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -115,9 +115,6 @@ func walkJSONFiles(inDir string, fn func(name, path string, data []byte)) error func TestExampleObjectSchemas(t *testing.T) { cases := map[string]map[string]runtime.Object{ - "../docs/getting-started-guides": { - "pod": &api.Pod{}, - }, "../cmd/integration": { "v1beta1-controller": &api.ReplicationController{}, "v1beta3-controller": &api.ReplicationController{}, @@ -177,6 +174,10 @@ func TestExampleObjectSchemas(t *testing.T) { "../examples/glusterfs/v1beta3": { "glusterfs": &api.Pod{}, }, + "../examples": { + "pod": &api.Pod{}, + "replication": &api.ReplicationController{}, + }, } for path, expected := range cases { @@ -225,14 +226,18 @@ var sampleRegexp = regexp.MustCompile("(?ms)^```(?:(?Pyaml)\\w*\\n(?P