@@ -109,7 +109,7 @@ These keys may be leveraged by the Salt sls files to branch behavior.
...
@@ -109,7 +109,7 @@ These keys may be leveraged by the Salt sls files to branch behavior.
In addition, a cluster may be running a Debian based operating system or Red Hat based operating system (Centos, Fedora, RHEL, etc.). As a result, it's important to sometimes distinguish behavior based on operating system using if branches like the following.
In addition, a cluster may be running a Debian based operating system or Red Hat based operating system (Centos, Fedora, RHEL, etc.). As a result, it's important to sometimes distinguish behavior based on operating system using if branches like the following.
```
```jinja
{%ifgrains['os_family']=='RedHat'%}
{%ifgrains['os_family']=='RedHat'%}
// something specific to a RedHat environment (Centos, Fedora, RHEL) where you may use yum, systemd, etc.
// something specific to a RedHat environment (Centos, Fedora, RHEL) where you may use yum, systemd, etc.
@@ -103,7 +103,6 @@ Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4
...
@@ -103,7 +103,6 @@ Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4
Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 monitoring-heapster-controller-oh43e Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods
Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 monitoring-heapster-controller-oh43e Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods
Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 kibana-logging-controller-gziey BoundPod implicitly required container POD pulled {kubelet kubernetes-minion-4.c.saad-dev-vms.internal} Successfully pulled image "kubernetes/pause:latest"
Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 kibana-logging-controller-gziey BoundPod implicitly required container POD pulled {kubelet kubernetes-minion-4.c.saad-dev-vms.internal} Successfully pulled image "kubernetes/pause:latest"
Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 kibana-logging-controller-gziey Pod scheduled {scheduler } Successfully assigned kibana-logging-controller-gziey to kubernetes-minion-4.c.saad-dev-vms.internal
Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 kibana-logging-controller-gziey Pod scheduled {scheduler } Successfully assigned kibana-logging-controller-gziey to kubernetes-minion-4.c.saad-dev-vms.internal
```
```
This demonstrates what would have been 20 separate entries (indicating scheduling failure) collapsed/compressed down to 5 entries.
This demonstrates what would have been 20 separate entries (indicating scheduling failure) collapsed/compressed down to 5 entries.
The first variable `nodes` defines all your cluster nodes, MASTER node comes first and separated with blank space like `<user_1@ip_1> <user_2@ip_2> <user_3@ip_3> `
The first variable `nodes` defines all your cluster nodes, MASTER node comes first and separated with blank space like `<user_1@ip_1> <user_2@ip_2> <user_3@ip_3> `
...
@@ -124,13 +122,11 @@ After all the above variable being set correctly. We can use below command in cl
...
@@ -124,13 +122,11 @@ After all the above variable being set correctly. We can use below command in cl
The scripts is automatically scp binaries and config files to all the machines and start the k8s service on them. The only thing you need to do is to type the sudo password when promoted. The current machine name is shown below like. So you will not type in the wrong password.
The scripts is automatically scp binaries and config files to all the machines and start the k8s service on them. The only thing you need to do is to type the sudo password when promoted. The current machine name is shown below like. So you will not type in the wrong password.
```console
```console
Deploying minion on machine 10.10.103.223
Deploying minion on machine 10.10.103.223
...
...
[sudo] password to copy files and start minion:
[sudo] password to copy files and start minion:
```
```
If all things goes right, you will see the below message from console
If all things goes right, you will see the below message from console
...
@@ -143,7 +139,6 @@ You can also use `kubectl` command to see if the newly created k8s is working co
...
@@ -143,7 +139,6 @@ You can also use `kubectl` command to see if the newly created k8s is working co
For example, use `$ kubectl get nodes` to see if all your nodes are in ready status. It may take some time for the nodes ready to use like below.
For example, use `$ kubectl get nodes` to see if all your nodes are in ready status. It may take some time for the nodes ready to use like below.
You may ssh to the host (the hostIP) and run 'mount' to see if the Glusterfs volume is mounted,
You may ssh to the host (the hostIP) and run 'mount' to see if the Glusterfs volume is mounted,
```shell
```sh
$ mount | grep kube_vol
$ mount | grep kube_vol
10.240.106.152:kube_vol on /var/lib/kubelet/pods/f164a571-fa68-11e4-ad5c-42010af019b7/volumes/kubernetes.io~glusterfs/glusterfsvol type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)
10.240.106.152:kube_vol on /var/lib/kubelet/pods/f164a571-fa68-11e4-ad5c-42010af019b7/volumes/kubernetes.io~glusterfs/glusterfsvol type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)
The nfs server pod creates a privileged container, so if you are using a Salt based KUBERNETES_PROVIDER (**gce**, **vagrant**, **aws**), you have to enable the ability to create privileged containers by API.
The nfs server pod creates a privileged container, so if you are using a Salt based KUBERNETES_PROVIDER (**gce**, **vagrant**, **aws**), you have to enable the ability to create privileged containers by API.
@@ -41,7 +41,7 @@ The example combines a web frontend and an external service that provides MySQL
...
@@ -41,7 +41,7 @@ The example combines a web frontend and an external service that provides MySQL
This example assumes that you have a basic understanding of kubernetes [services](../../docs/user-guide/services.md) and that you have forked the repository and [turned up a Kubernetes cluster](../../docs/getting-started-guides/):
This example assumes that you have a basic understanding of kubernetes [services](../../docs/user-guide/services.md) and that you have forked the repository and [turned up a Kubernetes cluster](../../docs/getting-started-guides/):
```shell
```sh
$ cd kubernetes
$ cd kubernetes
$ hack/dev-build-and-up.sh
$ hack/dev-build-and-up.sh
```
```
...
@@ -56,7 +56,7 @@ In the remaining part of this example we will assume that your instance is named
...
@@ -56,7 +56,7 @@ In the remaining part of this example we will assume that your instance is named
To start Phabricator server use the file [`examples/phabricator/phabricator-controller.json`](phabricator-controller.json) which describes a [replication controller](../../docs/user-guide/replication-controller.md) with a single [pod](../../docs/user-guide/pods.md) running an Apache server with Phabricator PHP source:
To start Phabricator server use the file [`examples/phabricator/phabricator-controller.json`](phabricator-controller.json) which describes a [replication controller](../../docs/user-guide/replication-controller.md) with a single [pod](../../docs/user-guide/pods.md) running an Apache server with Phabricator PHP source:
```js
```json
{
{
"kind":"ReplicationController",
"kind":"ReplicationController",
"apiVersion":"v1",
"apiVersion":"v1",
...
@@ -98,13 +98,13 @@ To start Phabricator server use the file [`examples/phabricator/phabricator-cont
...
@@ -98,13 +98,13 @@ To start Phabricator server use the file [`examples/phabricator/phabricator-cont
Create the phabricator pod in your Kubernetes cluster by running:
Create the phabricator pod in your Kubernetes cluster by running:
To automate this process and make sure that a proper host is authorized even if pod is rescheduled to a new machine we need a separate pod that periodically lists pods and authorizes hosts. Use the file [`examples/phabricator/authenticator-controller.json`](authenticator-controller.json):
To automate this process and make sure that a proper host is authorized even if pod is rescheduled to a new machine we need a separate pod that periodically lists pods and authorizes hosts. Use the file [`examples/phabricator/authenticator-controller.json`](authenticator-controller.json):
```js
```json
{
{
"kind":"ReplicationController",
"kind":"ReplicationController",
"apiVersion":"v1",
"apiVersion":"v1",
...
@@ -184,7 +184,7 @@ To automate this process and make sure that a proper host is authorized even if
...
@@ -184,7 +184,7 @@ To automate this process and make sure that a proper host is authorized even if
@@ -195,7 +195,7 @@ A Kubernetes 'service' is a named load balancer that proxies traffic to one or m
...
@@ -195,7 +195,7 @@ A Kubernetes 'service' is a named load balancer that proxies traffic to one or m
The pod that you created in Step One has the label `name=phabricator`. The selector field of the service determines which pods will receive the traffic sent to the service. Since we are setting up a service for an external application we also need to request external static IP address (otherwise it will be assigned dynamically):
The pod that you created in Step One has the label `name=phabricator`. The selector field of the service determines which pods will receive the traffic sent to the service. Since we are setting up a service for an external application we also need to request external static IP address (otherwise it will be assigned dynamically):
To play with the service itself, find the external IP of the load balancer:
To play with the service itself, find the external IP of the load balancer:
```shell
```sh
$ kubectl get services phabricator -o template --template='{{(index .status.loadBalancer.ingress 0).ip}}{{"\n"}}'
$ kubectl get services phabricator -o template --template='{{(index .status.loadBalancer.ingress 0).ip}}{{"\n"}}'
```
```
...
@@ -243,7 +243,7 @@ and then visit port 80 of that IP address.
...
@@ -243,7 +243,7 @@ and then visit port 80 of that IP address.
**Note**: You may need to open the firewall for port 80 using the [console][cloud-console] or the `gcloud` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
**Note**: You may need to open the firewall for port 80 using the [console][cloud-console] or the `gcloud` tool. The following command will allow traffic from any source to instances tagged `kubernetes-minion`:
### Check to see if Master is running and accessible
### Check to see if Master is running and accessible
```shell
```sh
$ kubectl get pods
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
NAME READY STATUS RESTARTS AGE
[...]
[...]
...
@@ -87,7 +87,7 @@ spark-master 1/1 Running 0 25
...
@@ -87,7 +87,7 @@ spark-master 1/1 Running 0 25
Check logs to see the status of the master.
Check logs to see the status of the master.
```shell
```sh
$ kubectl logs spark-master
$ kubectl logs spark-master
starting org.apache.spark.deploy.master.Master, logging to /opt/spark-1.4.0-bin-hadoop2.6/sbin/../logs/spark--org.apache.spark.deploy.master.Master-1-spark-master.out
starting org.apache.spark.deploy.master.Master, logging to /opt/spark-1.4.0-bin-hadoop2.6/sbin/../logs/spark--org.apache.spark.deploy.master.Master-1-spark-master.out
...
@@ -122,13 +122,13 @@ The Spark workers need the Master service to be running.
...
@@ -122,13 +122,13 @@ The Spark workers need the Master service to be running.
Use the [`examples/spark/spark-worker-controller.json`](spark-worker-controller.json) file to create a
Use the [`examples/spark/spark-worker-controller.json`](spark-worker-controller.json) file to create a
[replication controller](../../docs/user-guide/replication-controller.md) that manages the worker pods.
[replication controller](../../docs/user-guide/replication-controller.md) that manages the worker pods.