You need to wait for the provisioning to complete, you can monitor the minions by doing:
...
...
@@ -210,7 +210,7 @@ Once the docker image for nginx has been downloaded, the container will start an
$ sudo salt '*minion-1' cmd.run 'docker ps'
kubernetes-minion-1:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dbe79bf6e25b dockerfile/nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f
dbe79bf6e25b nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f
fa0e29c94501 kubernetes/pause:latest "/pause" 8 minutes ago Up 8 minutes 0.0.0.0:8080->80/tcp k8s--net.a90e7ce4--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--baf5b21b
```
...
...
@@ -219,16 +219,16 @@ Going back to listing the pods, services and replicationControllers, you now hav
You need to wait for the provisioning to complete, you can monitor the minions by doing:
...
...
@@ -217,7 +217,7 @@ Once the docker image for nginx has been downloaded, the container will start an
$ sudo salt '*minion-1' cmd.run 'docker ps'
kubernetes-minion-1:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dbe79bf6e25b dockerfile/nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f
dbe79bf6e25b nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f
fa0e29c94501 kubernetes/pause:latest "/pause" 8 minutes ago Up 8 minutes 0.0.0.0:8080->80/tcp k8s--net.a90e7ce4--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--baf5b21b
aa2ee3ed844a google/cadvisor:latest "/usr/bin/cadvisor - 38 minutes ago Up 38 minutes k8s--cadvisor.9e90d182--cadvisor_-_agent.file--4626b3a2
65a3a926f357 kubernetes/pause:latest "/pause" 39 minutes ago Up 39 minutes 0.0.0.0:4194->8080/tcp k8s--net.c5ba7f0e--cadvisor_-_agent.file--342fd561
...
...
@@ -228,16 +228,16 @@ Going back to listing the pods, services and replicationControllers, you now hav
@@ -79,7 +79,7 @@ A RabbitMQ broker can be turned up using the file `examples/celery-rabbitmq/rabb
"id":"rabbitmq",
"containers":[{
"name":"rabbitmq",
"image":"dockerfile/rabbitmq",
"image":"library/rabbitmq",
"cpu":100,
"ports":[{"containerPort":5672,"hostPort":5672}]
}]
...
...
@@ -144,7 +144,7 @@ There are several things to point out here...
Like the RabbitMQ controller, this controller ensures that there is always a pod is running a Celery worker instance. The celery-app-add Docker image is an extension of the standard Celery image. This is the Dockerfile:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0ffef9649265 dockerfile/redis:latest"redis-server /etc/r About a minute ago Up About a minute k8s_redis-master.767aef46_redis-master-controller-gb50a.default.api_4530d7b3-ae5d-11e4-bf77-42010af0d719_579ee964
0ffef9649265 redis:latest "redis-server /etc/r About a minute ago Up About a minute k8s_redis-master.767aef46_redis-master-controller-gb50a.default.api_4530d7b3-ae5d-11e4-bf77-42010af0d719_579ee964
```
(Note that initial `docker pull` may take a few minutes, depending on network conditions. You can monitor the status of this by running `journalctl -f -u docker` to check when the image is being downloaded. Of course, you can also run `journalctl -f -u kubelet` to see what state the kubelet is in as well during this time.
A pod definition is a declaration of a _desired state_. Desired state is a very important concept in the Kubernetes model. Many things present a desired state to the system, and it is Kubernetes' responsibility to make sure that the current state matches the desired state. For example, when you create a Pod, you declare that you want the containers in it to be running. If the containers happen to not be running (e.g. program failure, ...), Kubernetes will continue to (re-)create them for you in order to drive them to the desired state. This process continues until you delete the Pod.
...
...
@@ -40,7 +40,7 @@ desiredState:
id:storage
containers:
-name:redis
image:dockerfile/redis
image:redis
volumeMounts:
# name must match the volume name below
-name:redis-persistent-storage
...
...
@@ -55,23 +55,23 @@ desiredState:
Ok, so what did we do? We added a volume to our pod:
```yaml
...
# ...
volumes:
-name:redis-persistent-storage
source:
emptyDir:{}
...
# ...
```
And we added a reference to that volume to our container:
```yaml
...
# ...
volumeMounts:
# name must match the volume name below
-name:redis-persistent-storage
# mount path within the container
mountPath:/data/redis
...
# ...
```
In Kubernetes, ```emptyDir``` Volumes live for the lifespan of the Pod, which is longer than the lifespan of any one container, so if the container fails and is restarted, our persistent storage will live on.
...
...
@@ -98,7 +98,7 @@ desiredState:
id:www
containers:
-name:nginx
image:dockerfile/nginx
image:nginx
volumeMounts:
-name:www-data
mountPath:/srv/www
...
...
@@ -114,7 +114,7 @@ desiredState:
volumes:
-name:www-data
source:
emptyDir
emptyDir:{}
```
Note that we have also added a volume here. In this case, the volume is mounted into both containers. It is marked ```readOnly``` in the web server's case, since it doesn't need to write to the directory.