@@ -6,7 +6,7 @@ The exec healthz server is a sidecar container meant to serve as a liveness-exec
...
@@ -6,7 +6,7 @@ The exec healthz server is a sidecar container meant to serve as a liveness-exec
### Run the healthz server directly on localhost:
### Run the healthz server directly on localhost:
```shell
```sh
$ make server
$ make server
$ ./exechealthz -cmd"ls /tmp/test"
$ ./exechealthz -cmd"ls /tmp/test"
$ curl http://localhost:8080/healthz
$ curl http://localhost:8080/healthz
...
@@ -20,7 +20,7 @@ ok
...
@@ -20,7 +20,7 @@ ok
### Run the healthz server in a docker container:
### Run the healthz server in a docker container:
The [docker daemon](https://docs.docker.com/userguide/) needs to be running on your host.
The [docker daemon](https://docs.docker.com/userguide/) needs to be running on your host.
```shell
```sh
$ make container PREFIX=mycontainer/test
$ make container PREFIX=mycontainer/test
$ docker run -itP-p 8080:8080 mycontainer/test:0.0 -cmd"ls /tmp/test"
$ docker run -itP-p 8080:8080 mycontainer/test:0.0 -cmd"ls /tmp/test"
$ curl http://localhost:8080/healthz
$ curl http://localhost:8080/healthz
...
@@ -67,7 +67,7 @@ Create a pod.json that looks like:
...
@@ -67,7 +67,7 @@ Create a pod.json that looks like:
```
```
And run the pod on your cluster using kubectl:
And run the pod on your cluster using kubectl:
```shell
```sh
$ kubectl create -f pod.json
$ kubectl create -f pod.json
pods/simple
pods/simple
$ kubectl get pods -o wide
$ kubectl get pods -o wide
...
@@ -76,7 +76,7 @@ simple 0/1 Pending 0 3s node
...
@@ -76,7 +76,7 @@ simple 0/1 Pending 0 3s node
```
```
SSH into the node (note that the recommended way to access a server in a container is through a [service](../../docs/services.md), the example that follows is just to illustrate how the kubelet performs an http liveness probe):
SSH into the node (note that the recommended way to access a server in a container is through a [service](../../docs/services.md), the example that follows is just to illustrate how the kubelet performs an http liveness probe):
```shell
```sh
node$ kubectl get pods simple -o json | grep podIP
node$ kubectl get pods simple -o json | grep podIP
@@ -39,7 +39,7 @@ This is a toy example demonstrating how to use kubernetes DNS.
...
@@ -39,7 +39,7 @@ This is a toy example demonstrating how to use kubernetes DNS.
This example assumes that you have forked the repository and [turned up a Kubernetes cluster](../../docs/getting-started-guides/). Make sure DNS is enabled in your setup, see [DNS doc](../../cluster/addons/dns/).
This example assumes that you have forked the repository and [turned up a Kubernetes cluster](../../docs/getting-started-guides/). Make sure DNS is enabled in your setup, see [DNS doc](../../cluster/addons/dns/).
```shell
```sh
$ cd kubernetes
$ cd kubernetes
$ hack/dev-build-and-up.sh
$ hack/dev-build-and-up.sh
```
```
...
@@ -48,14 +48,14 @@ $ hack/dev-build-and-up.sh
...
@@ -48,14 +48,14 @@ $ hack/dev-build-and-up.sh
We'll see how cluster DNS works across multiple [namespaces](../../docs/user-guide/namespaces.md), first we need to create two namespaces:
We'll see how cluster DNS works across multiple [namespaces](../../docs/user-guide/namespaces.md), first we need to create two namespaces:
@@ -76,14 +76,14 @@ You can view your cluster name and user name in kubernetes config at ~/.kube/con
...
@@ -76,14 +76,14 @@ You can view your cluster name and user name in kubernetes config at ~/.kube/con
Use the file [`examples/cluster-dns/dns-backend-rc.yaml`](dns-backend-rc.yaml) to create a backend server [replication controller](../../docs/user-guide/replication-controller.md) in each namespace.
Use the file [`examples/cluster-dns/dns-backend-rc.yaml`](dns-backend-rc.yaml) to create a backend server [replication controller](../../docs/user-guide/replication-controller.md) in each namespace.
Use the file [`examples/cluster-dns/dns-frontend-pod.yaml`](dns-frontend-pod.yaml) to create a client [pod](../../docs/user-guide/pods.md) in dev namespace. The client pod will make a connection to backend and exit. Specifically, it tries to connect to address `http://dns-backend.development.cluster.local:8000`.
Use the file [`examples/cluster-dns/dns-frontend-pod.yaml`](dns-frontend-pod.yaml) to create a client [pod](../../docs/user-guide/pods.md) in dev namespace. The client pod will make a connection to backend and exit. Specifically, it tries to connect to address `http://dns-backend.development.cluster.local:8000`.
Note that we've defined a volume mount for `/var/lib/mysql`, and specified a volume that uses the persistent disk (`mysql-disk`) that you created.
Note that we've defined a volume mount for `/var/lib/mysql`, and specified a volume that uses the persistent disk (`mysql-disk`) that you created.
Once you've edited the file to set your database password, create the pod as follows, where `<kubernetes>` is the path to your Kubernetes installation:
Once you've edited the file to set your database password, create the pod as follows, where `<kubernetes>` is the path to your Kubernetes installation:
@@ -289,7 +289,7 @@ $ kubectl get services/wpfrontend --template="{{range .status.loadBalancer.ingre
...
@@ -289,7 +289,7 @@ $ kubectl get services/wpfrontend --template="{{range .status.loadBalancer.ingre
or by listing the forwarding rules for your project:
or by listing the forwarding rules for your project:
```shell
```sh
$ gcloud compute forwarding-rules list
$ gcloud compute forwarding-rules list
```
```
...
@@ -299,7 +299,7 @@ Look for the rule called `wpfrontend`, which is what we named the wordpress serv
...
@@ -299,7 +299,7 @@ Look for the rule called `wpfrontend`, which is what we named the wordpress serv
To access your new installation, you first may need to open up port 80 (the port specified in the wordpress service config) in the firewall for your cluster. You can do this, e.g. via:
To access your new installation, you first may need to open up port 80 (the port specified in the wordpress service config) in the firewall for your cluster. You can do this, e.g. via:
Grab the public IP address of the service we previously created.
Grab the public IP address of the service we previously created.
```shell
```sh
$ export PUBLIC_IP=$(cluster/kubectl.sh get services openshift --template="{{ index .status.loadBalancer.ingress 0 \"ip\" }}")
$ export PUBLIC_IP=$(cluster/kubectl.sh get services openshift --template="{{ index .status.loadBalancer.ingress 0 \"ip\" }}")
$ echo$PUBLIC_IP
$ echo$PUBLIC_IP
```
```
...
@@ -116,7 +116,7 @@ Ensure you have a valid PUBLIC_IP address before continuing in the example.
...
@@ -116,7 +116,7 @@ Ensure you have a valid PUBLIC_IP address before continuing in the example.
We now need to run a command on your host to generate a proper OpenShift configuration. To do this, we will volume mount the configuration directory that holds your Kubernetes kubeconfig file from the prior step.
We now need to run a command on your host to generate a proper OpenShift configuration. To do this, we will volume mount the configuration directory that holds your Kubernetes kubeconfig file from the prior step.
```shell
```sh
docker run --privileged-v${OPENSHIFT_CONFIG}:/config openshift/origin start master --write-config=/config --kubeconfig='/config/kubeconfig'--master='https://localhost:8443'--public-master='https://${PUBLIC_IP}:8443'
docker run --privileged-v${OPENSHIFT_CONFIG}:/config openshift/origin start master --write-config=/config --kubeconfig='/config/kubeconfig'--master='https://localhost:8443'--public-master='https://${PUBLIC_IP}:8443'
@@ -155,13 +155,13 @@ We are now ready to deploy OpenShift.
...
@@ -155,13 +155,13 @@ We are now ready to deploy OpenShift.
We will deploy a pod that runs the OpenShift master. The OpenShift master will delegate to the underlying Kubernetes
We will deploy a pod that runs the OpenShift master. The OpenShift master will delegate to the underlying Kubernetes
system to manage Kubernetes specific resources. For the sake of simplicity, the OpenShift master will run with an embedded etcd to hold OpenShift specific content. This demonstration will evolve in the future to show how to run etcd in a pod so that content is not destroyed if the OpenShift master fails.
system to manage Kubernetes specific resources. For the sake of simplicity, the OpenShift master will run with an embedded etcd to hold OpenShift specific content. This demonstration will evolve in the future to show how to run etcd in a pod so that content is not destroyed if the OpenShift master fails.