Merge pull request #6917 from thockin/dockerfile-images-are-dead

Stop using dockerfile/* images
This commit is contained in:
Alex Robinson 2015-04-16 13:30:50 -07:00
commit e1f67ff31b
21 changed files with 54 additions and 38 deletions

View File

@ -79,7 +79,7 @@ A RabbitMQ broker can be turned up using the file `examples/celery-rabbitmq/rabb
"id": "rabbitmq", "id": "rabbitmq",
"containers": [{ "containers": [{
"name": "rabbitmq", "name": "rabbitmq",
"image": "dockerfile/rabbitmq", "image": "library/rabbitmq",
"cpu": 100, "cpu": 100,
"ports": [{"containerPort": 5672, "hostPort": 5672}] "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: 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:
``` ```
FROM dockerfile/celery FROM library/celery
ADD celery_conf.py /data/celery_conf.py ADD celery_conf.py /data/celery_conf.py
ADD run_tasks.py /data/run_tasks.py ADD run_tasks.py /data/run_tasks.py
@ -239,7 +239,7 @@ flower-controller-cegta 10.246.2.17 flower endocode/flo
kube-dns-fplln 10.246.1.3 etcd quay.io/coreos/etcd:latest 10.245.1.3/10.245.1.3 k8s-app=kube-dns,kubernetes.io/cluster-service=true Running kube-dns-fplln 10.246.1.3 etcd quay.io/coreos/etcd:latest 10.245.1.3/10.245.1.3 k8s-app=kube-dns,kubernetes.io/cluster-service=true Running
kube2sky kubernetes/kube2sky:1.0 kube2sky kubernetes/kube2sky:1.0
skydns kubernetes/skydns:2014-12-23-001 skydns kubernetes/skydns:2014-12-23-001
rabbitmq-controller-pjzb3 10.246.2.16 rabbitmq dockerfile/rabbitmq 10.245.1.4/10.245.1.4 app=taskQueue,name=rabbitmq Running rabbitmq-controller-pjzb3 10.246.2.16 rabbitmq library/rabbitmq 10.245.1.4/10.245.1.4 app=taskQueue,name=rabbitmq Running
``` ```

View File

@ -1,4 +1,4 @@
FROM dockerfile/celery FROM library/celery
ADD celery_conf.py /data/celery_conf.py ADD celery_conf.py /data/celery_conf.py
ADD run_tasks.py /data/run_tasks.py ADD run_tasks.py /data/run_tasks.py

View File

@ -12,7 +12,7 @@
"id": "rabbitmq", "id": "rabbitmq",
"containers": [{ "containers": [{
"name": "rabbitmq", "name": "rabbitmq",
"image": "dockerfile/rabbitmq", "image": "library/rabbitmq",
"cpu": 100, "cpu": 100,
"ports": [{"containerPort": 5672, "hostPort": 5672}] "ports": [{"containerPort": 5672, "hostPort": 5672}]
}] }]

View File

@ -212,7 +212,23 @@ func TestExampleObjectSchemas(t *testing.T) {
} }
} }
var sampleRegexp = regexp.MustCompile("(?ms)^```(?:(?P<type>yaml)\\w*\\n(?P<content>.+?)|\\w*\\n(?P<content>\\{.+?\\}))\\w*\\n^```") // This regex is tricky, but it works. For future me, here is the decode:
//
// Flags: (?ms) = multiline match, allow . to match \n
// 1) Look for a line that starts with ``` (a markdown code block)
// 2) (?: ... ) = non-capturing group
// 3) (P<name>) = capture group as "name"
// 4) Look for #1 followed by either:
// 4a) "yaml" followed by any word-characters followed by a newline (e.g. ```yamlfoo\n)
// 4b) "any word-characters followed by a newline (e.g. ```json\n)
// 5) Look for either:
// 5a) #4a followed by one or more characters (non-greedy)
// 5b) #4b followed by { followed by one or more characters (non-greedy) followed by }
// 6) Look for #5 followed by a newline followed by ``` (end of the code block)
//
// This could probably be simplified, but is already too delicate. Before any
// real changes, we should have a testscase that just tests this regex.
var sampleRegexp = regexp.MustCompile("(?ms)^```(?:(?P<type>yaml)\\w*\\n(?P<content>.+?)|\\w*\\n(?P<content>\\{.+?\\}))\\n^```")
var subsetRegexp = regexp.MustCompile("(?ms)\\.{3}") var subsetRegexp = regexp.MustCompile("(?ms)\\.{3}")
func TestReadme(t *testing.T) { func TestReadme(t *testing.T) {

View File

@ -39,7 +39,7 @@ Note that, although the redis server runs just with a single replica, we use rep
"id": "redis-master", "id": "redis-master",
"containers": [{ "containers": [{
"name": "redis-master", "name": "redis-master",
"image": "dockerfile/redis", "image": "redis",
"ports": [{ "ports": [{
"containerPort": 6379, # containerPort: Where traffic to redis ultimately is routed to. "containerPort": 6379, # containerPort: Where traffic to redis ultimately is routed to.
}] }]
@ -65,7 +65,7 @@ $ kubectl create -f examples/guestbook/redis-master-controller.json
$ cluster/kubectl.sh get rc $ cluster/kubectl.sh get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
redis-master-controller redis-master dockerfile/redis name=redis-master 1 redis-master-controller redis-master redis name=redis-master 1
``` ```
Once that's up you can list the pods in the cluster, to verify that the master is running: Once that's up you can list the pods in the cluster, to verify that the master is running:
@ -78,7 +78,7 @@ You'll see all kubernetes components, most importantly the redis master pod. It
```shell ```shell
POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS
redis-master-controller-gb50a 10.244.3.7 redis-master dockerfile/redis kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running redis-master-controller-gb50a 10.244.3.7 redis-master redis kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running
``` ```
If you ssh to that machine, you can run `docker ps` to see the actual pod: If you ssh to that machine, you can run `docker ps` to see the actual pod:
@ -88,7 +88,7 @@ me@workstation$ gcloud compute ssh kubernetes-minion-7agi
me@kubernetes-minion-7agi:~$ sudo docker ps me@kubernetes-minion-7agi:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 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. (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.
@ -182,7 +182,7 @@ redis-slave-controller
$ kubectl get rc $ kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
redis-master-controller redis-master dockerfile/redis name=redis-master 1 redis-master-controller redis-master redis name=redis-master 1
redis-slave-controller redis-slave kubernetes/redis-slave:v2 name=redis-slave 2 redis-slave-controller redis-slave kubernetes/redis-slave:v2 name=redis-slave 2
``` ```
@ -197,7 +197,7 @@ Once that's up you can list the pods in the cluster, to verify that the master a
```shell ```shell
$ kubectl get pods $ kubectl get pods
POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS
redis-master-controller-gb50a 10.244.3.7 redis-master dockerfile/redis kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running redis-master-controller-gb50a 10.244.3.7 redis-master redis kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running
redis-slave-controller-182tv 10.244.3.6 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-slave,uses=redis-master Running redis-slave-controller-182tv 10.244.3.6 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-slave,uses=redis-master Running
redis-slave-controller-zwk1b 10.244.2.8 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-3vxa.c.hazel-mote-834.internal/104.154.54.6 app=redis,name=redis-slave,uses=redis-master Running redis-slave-controller-zwk1b 10.244.2.8 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-3vxa.c.hazel-mote-834.internal/104.154.54.6 app=redis,name=redis-slave,uses=redis-master Running
``` ```
@ -287,7 +287,7 @@ frontend-controller
$ kubectl get rc $ kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
frontend-controller php-redis kubernetes/example-guestbook-php-redis:v2 name=frontend 3 frontend-controller php-redis kubernetes/example-guestbook-php-redis:v2 name=frontend 3
redis-master-controller redis-master dockerfile/redis name=redis-master 1 redis-master-controller redis-master redis name=redis-master 1
redis-slave-controller redis-slave kubernetes/redis-slave:v2 name=redis-slave 2 redis-slave-controller redis-slave kubernetes/redis-slave:v2 name=redis-slave 2
``` ```
@ -299,7 +299,7 @@ POD IP CONTAINER(S)
frontend-controller-5m1zc 10.244.1.131 php-redis kubernetes/example-guestbook-php-redis:v2 kubernetes-minion-3vxa.c.hazel-mote-834.internal/146.148.71.71 app=frontend,name=frontend,uses=redis-slave,redis-master Running frontend-controller-5m1zc 10.244.1.131 php-redis kubernetes/example-guestbook-php-redis:v2 kubernetes-minion-3vxa.c.hazel-mote-834.internal/146.148.71.71 app=frontend,name=frontend,uses=redis-slave,redis-master Running
frontend-controller-ckn42 10.244.2.134 php-redis kubernetes/example-guestbook-php-redis:v2 kubernetes-minion-by92.c.hazel-mote-834.internal/104.154.54.6 app=frontend,name=frontend,uses=redis-slave,redis-master Running frontend-controller-ckn42 10.244.2.134 php-redis kubernetes/example-guestbook-php-redis:v2 kubernetes-minion-by92.c.hazel-mote-834.internal/104.154.54.6 app=frontend,name=frontend,uses=redis-slave,redis-master Running
frontend-controller-v5drx 10.244.0.128 php-redis kubernetes/example-guestbook-php-redis:v2 kubernetes-minion-wilb.c.hazel-mote-834.internal/23.236.61.63 app=frontend,name=frontend,uses=redis-slave,redis-master Running frontend-controller-v5drx 10.244.0.128 php-redis kubernetes/example-guestbook-php-redis:v2 kubernetes-minion-wilb.c.hazel-mote-834.internal/23.236.61.63 app=frontend,name=frontend,uses=redis-slave,redis-master Running
redis-master-controller-gb50a 10.244.3.7 redis-master dockerfile/redis kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running redis-master-controller-gb50a 10.244.3.7 redis-master redis kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-master Running
redis-slave-controller-182tv 10.244.3.6 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-slave,uses=redis-master Running redis-slave-controller-182tv 10.244.3.6 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-7agi.c.hazel-mote-834.internal/104.154.54.203 app=redis,name=redis-slave,uses=redis-master Running
redis-slave-controller-zwk1b 10.244.2.8 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-3vxa.c.hazel-mote-834.internal/104.154.54.6 app=redis,name=redis-slave,uses=redis-master Running redis-slave-controller-zwk1b 10.244.2.8 redis-slave kubernetes/redis-slave:v2 kubernetes-minion-3vxa.c.hazel-mote-834.internal/104.154.54.6 app=redis,name=redis-slave,uses=redis-master Running
``` ```

View File

@ -1,4 +1,4 @@
FROM dockerfile/redis FROM redis
ADD run.sh /run.sh ADD run.sh /run.sh

View File

@ -22,7 +22,7 @@
"containers":[ "containers":[
{ {
"name":"master", "name":"master",
"image":"dockerfile/redis", "image":"redis",
"ports":[ "ports":[
{ {
"containerPort":6379, "containerPort":6379,

View File

@ -5,7 +5,7 @@
# #
# Pull base image. # Pull base image.
FROM dockerfile/ubuntu FROM ubuntu
# Install Redis. # Install Redis.
RUN \ RUN \

View File

@ -9,7 +9,7 @@ metadata:
spec: spec:
containers: containers:
- name: web - name: web
image: dockerfile/nginx image: nginx
ports: ports:
- name: web - name: web
containerPort: 80 containerPort: 80

View File

@ -4,7 +4,7 @@ metadata:
name: mypod name: mypod
spec: spec:
containers: containers:
- image: dockerfile/nginx - image: nginx
name: myfrontend name: myfrontend
volumeMounts: volumeMounts:
- mountPath: "/var/www/html" - mountPath: "/var/www/html"

View File

@ -19,7 +19,7 @@ desiredState:
id: www id: www
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
``` ```
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. 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 id: storage
containers: containers:
- name: redis - name: redis
image: dockerfile/redis image: redis
volumeMounts: volumeMounts:
# name must match the volume name below # name must match the volume name below
- name: redis-persistent-storage - name: redis-persistent-storage
@ -55,23 +55,23 @@ desiredState:
Ok, so what did we do? We added a volume to our pod: Ok, so what did we do? We added a volume to our pod:
```yaml ```yaml
... # ...
volumes: volumes:
- name: redis-persistent-storage - name: redis-persistent-storage
source: source:
emptyDir: {} emptyDir: {}
... # ...
``` ```
And we added a reference to that volume to our container: And we added a reference to that volume to our container:
```yaml ```yaml
... # ...
volumeMounts: volumeMounts:
# name must match the volume name below # name must match the volume name below
- name: redis-persistent-storage - name: redis-persistent-storage
# mount path within the container # mount path within the container
mountPath: /data/redis 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. 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 id: www
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
volumeMounts: volumeMounts:
- name: www-data - name: www-data
mountPath: /srv/www mountPath: /srv/www
@ -114,7 +114,7 @@ desiredState:
volumes: volumes:
- name: www-data - name: www-data
source: 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. 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.

View File

@ -41,7 +41,7 @@ desiredState:
id: nginx id: nginx
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
ports: ports:
- containerPort: 80 - containerPort: 80
# Important: these labels need to match the selector above # Important: these labels need to match the selector above
@ -135,7 +135,7 @@ desiredState:
id: php id: php
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
ports: ports:
- containerPort: 80 - containerPort: 80
# defines the health checking # defines the health checking

View File

@ -7,7 +7,7 @@ desiredState:
id: php id: php
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
ports: ports:
- containerPort: 80 - containerPort: 80
# defines the health checking # defines the health checking

View File

@ -7,4 +7,4 @@ desiredState:
id: www id: www
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx

View File

@ -7,7 +7,7 @@ desiredState:
id: storage id: storage
containers: containers:
- name: redis - name: redis
image: dockerfile/redis image: redis
volumeMounts: volumeMounts:
# name must match the volume name below # name must match the volume name below
- name: redis-persistent-storage - name: redis-persistent-storage

View File

@ -16,7 +16,7 @@ desiredState:
id: nginx id: nginx
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
ports: ports:
- containerPort: 80 - containerPort: 80
# Important: these labels need to match the selector above # Important: these labels need to match the selector above

View File

@ -40,7 +40,7 @@ metadata:
spec: spec:
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
volumeMounts: volumeMounts:
- mountPath: /srv/www - mountPath: /srv/www
name: www-data name: www-data

View File

@ -5,7 +5,7 @@ metadata:
spec: spec:
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
# defines the health checking # defines the health checking
livenessProbe: livenessProbe:
# an http probe # an http probe

View File

@ -5,4 +5,4 @@ metadata:
spec: spec:
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx

View File

@ -5,7 +5,7 @@ metadata:
spec: spec:
containers: containers:
- name: redis - name: redis
image: dockerfile/redis image: redis
volumeMounts: volumeMounts:
# name must match the volume name below # name must match the volume name below
- name: redis-persistent-storage - name: redis-persistent-storage

View File

@ -19,6 +19,6 @@ spec:
spec: spec:
containers: containers:
- name: nginx - name: nginx
image: dockerfile/nginx image: nginx
ports: ports:
- containerPort: 80 - containerPort: 80