Improve markdown highlighting in mesos getting started guide.

This commit is contained in:
Alex Robinson 2015-07-18 18:55:08 -07:00
parent 6ae88fc1dc
commit f729938aed

View File

@ -83,18 +83,18 @@ ssh jclouds@${ip_address_of_master_node}
Build Kubernetes-Mesos. Build Kubernetes-Mesos.
```bash ```bash
$ git clone https://github.com/GoogleCloudPlatform/kubernetes git clone https://github.com/GoogleCloudPlatform/kubernetes
$ cd kubernetes cd kubernetes
$ export KUBERNETES_CONTRIB=mesos export KUBERNETES_CONTRIB=mesos
$ make make
``` ```
Set some environment variables. Set some environment variables.
The internal IP address of the master may be obtained via `hostname -i`. The internal IP address of the master may be obtained via `hostname -i`.
```bash ```bash
$ export KUBERNETES_MASTER_IP=$(hostname -i) export KUBERNETES_MASTER_IP=$(hostname -i)
$ export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888 export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888
``` ```
### Deploy etcd ### Deploy etcd
@ -102,10 +102,10 @@ $ export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888
Start etcd and verify that it is running: Start etcd and verify that it is running:
```bash ```bash
$ sudo docker run -d --hostname $(uname -n) --name etcd -p 4001:4001 -p 7001:7001 quay.io/coreos/etcd:v2.0.12 sudo docker run -d --hostname $(uname -n) --name etcd -p 4001:4001 -p 7001:7001 quay.io/coreos/etcd:v2.0.12
``` ```
```bash ```console
$ sudo docker ps $ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd7bac9e2301 quay.io/coreos/etcd:v2.0.12 "/etcd" 5s ago Up 3s 2379/tcp, 2380/... etcd fd7bac9e2301 quay.io/coreos/etcd:v2.0.12 "/etcd" 5s ago Up 3s 2379/tcp, 2380/... etcd
@ -124,19 +124,19 @@ If connectivity is OK, you will see an output of the available keys in etcd (if
Update your PATH to more easily run the Kubernetes-Mesos binaries: Update your PATH to more easily run the Kubernetes-Mesos binaries:
```bash ```bash
$ export PATH="$(pwd)/_output/local/go/bin:$PATH" export PATH="$(pwd)/_output/local/go/bin:$PATH"
``` ```
Identify your Mesos master: depending on your Mesos installation this is either a `host:port` like `mesos_master:5050` or a ZooKeeper URL like `zk://zookeeper:2181/mesos`. Identify your Mesos master: depending on your Mesos installation this is either a `host:port` like `mesos_master:5050` or a ZooKeeper URL like `zk://zookeeper:2181/mesos`.
In order to let Kubernetes survive Mesos master changes, the ZooKeeper URL is recommended for production environments. In order to let Kubernetes survive Mesos master changes, the ZooKeeper URL is recommended for production environments.
```bash ```bash
$ export MESOS_MASTER=<host:port or zk:// url> export MESOS_MASTER=<host:port or zk:// url>
``` ```
Create a cloud config file `mesos-cloud.conf` in the current directory with the following contents: Create a cloud config file `mesos-cloud.conf` in the current directory with the following contents:
```bash ```console
$ cat <<EOF >mesos-cloud.conf $ cat <<EOF >mesos-cloud.conf
[mesos-cloud] [mesos-cloud]
mesos-master = ${MESOS_MASTER} mesos-master = ${MESOS_MASTER}
@ -145,7 +145,7 @@ EOF
Now start the kubernetes-mesos API server, controller manager, and scheduler on the master node: Now start the kubernetes-mesos API server, controller manager, and scheduler on the master node:
```bash ```console
$ km apiserver \ $ km apiserver \
--address=${KUBERNETES_MASTER_IP} \ --address=${KUBERNETES_MASTER_IP} \
--etcd-servers=http://${KUBERNETES_MASTER_IP}:4001 \ --etcd-servers=http://${KUBERNETES_MASTER_IP}:4001 \
@ -175,7 +175,7 @@ $ km scheduler \
Disown your background jobs so that they'll stay running if you log out. Disown your background jobs so that they'll stay running if you log out.
```bash ```bash
$ disown -a disown -a
``` ```
#### Validate KM Services #### Validate KM Services
@ -188,12 +188,12 @@ export PATH=<path/to/kubernetes-directory>/platforms/linux/amd64:$PATH
Interact with the kubernetes-mesos framework via `kubectl`: Interact with the kubernetes-mesos framework via `kubectl`:
```bash ```console
$ kubectl get pods $ kubectl get pods
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
``` ```
```bash ```console
# NOTE: your service IPs will likely differ # NOTE: your service IPs will likely differ
$ kubectl get services $ kubectl get services
NAME LABELS SELECTOR IP(S) PORT(S) NAME LABELS SELECTOR IP(S) PORT(S)
@ -211,6 +211,9 @@ Write a JSON pod description to a local file:
```bash ```bash
$ cat <<EOPOD >nginx.yaml $ cat <<EOPOD >nginx.yaml
```
```yaml
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
@ -226,7 +229,7 @@ EOPOD
Send the pod description to Kubernetes using the `kubectl` CLI: Send the pod description to Kubernetes using the `kubectl` CLI:
```bash ```console
$ kubectl create -f ./nginx.yaml $ kubectl create -f ./nginx.yaml
pods/nginx pods/nginx
``` ```
@ -234,7 +237,7 @@ pods/nginx
Wait a minute or two while `dockerd` downloads the image layers from the internet. Wait a minute or two while `dockerd` downloads the image layers from the internet.
We can use the `kubectl` interface to monitor the status of our pod: We can use the `kubectl` interface to monitor the status of our pod:
```bash ```console
$ kubectl get pods $ kubectl get pods
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 14s nginx 1/1 Running 0 14s
@ -295,6 +298,9 @@ To check that the new DNS service in the cluster works, we start a busybox pod a
```bash ```bash
cat <<EOF >busybox.yaml cat <<EOF >busybox.yaml
```
```yaml
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
@ -326,7 +332,7 @@ kubectl exec busybox -- nslookup kubernetes
If everything works fine, you will get this output: If everything works fine, you will get this output:
``` ```console
Server: 10.10.10.10 Server: 10.10.10.10
Address 1: 10.10.10.10 Address 1: 10.10.10.10