Add a central simple getting started guide with kubernetes guide.

Point several getting started guides at this doc.
This commit is contained in:
Brendan Burns
2015-04-30 22:16:59 -07:00
parent 262c34e7db
commit 37eedef348
10 changed files with 214 additions and 213 deletions

View File

@@ -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://<external ip of minion running nginx>:<port from manifest>.
Look in `examples/` for more examples
### Tearing down the cluster