diff --git a/celery-rabbitmq/README.md b/celery-rabbitmq/README.md index a2f465e1..b920d30a 100644 --- a/celery-rabbitmq/README.md +++ b/celery-rabbitmq/README.md @@ -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: ``` -FROM dockerfile/celery +FROM library/celery ADD celery_conf.py /data/celery_conf.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 kube2sky kubernetes/kube2sky:1.0 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 ``` diff --git a/celery-rabbitmq/celery-app-add/Dockerfile b/celery-rabbitmq/celery-app-add/Dockerfile index 2460e9f8..f507e0df 100644 --- a/celery-rabbitmq/celery-app-add/Dockerfile +++ b/celery-rabbitmq/celery-app-add/Dockerfile @@ -1,4 +1,4 @@ -FROM dockerfile/celery +FROM library/celery ADD celery_conf.py /data/celery_conf.py ADD run_tasks.py /data/run_tasks.py diff --git a/celery-rabbitmq/rabbitmq-controller.json b/celery-rabbitmq/rabbitmq-controller.json index 58e8754d..ffeb78e2 100644 --- a/celery-rabbitmq/rabbitmq-controller.json +++ b/celery-rabbitmq/rabbitmq-controller.json @@ -12,7 +12,7 @@ "id": "rabbitmq", "containers": [{ "name": "rabbitmq", - "image": "dockerfile/rabbitmq", + "image": "library/rabbitmq", "cpu": 100, "ports": [{"containerPort": 5672, "hostPort": 5672}] }] diff --git a/examples_test.go b/examples_test.go index e0d9cebc..994ba7ea 100644 --- a/examples_test.go +++ b/examples_test.go @@ -212,7 +212,23 @@ func TestExampleObjectSchemas(t *testing.T) { } } -var sampleRegexp = regexp.MustCompile("(?ms)^```(?:(?Pyaml)\\w*\\n(?P.+?)|\\w*\\n(?P\\{.+?\\}))\\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) = 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)^```(?:(?Pyaml)\\w*\\n(?P.+?)|\\w*\\n(?P\\{.+?\\}))\\n^```") var subsetRegexp = regexp.MustCompile("(?ms)\\.{3}") func TestReadme(t *testing.T) { diff --git a/guestbook/README.md b/guestbook/README.md index dd1766ca..c6735be2 100644 --- a/guestbook/README.md +++ b/guestbook/README.md @@ -39,7 +39,7 @@ Note that, although the redis server runs just with a single replica, we use rep "id": "redis-master", "containers": [{ "name": "redis-master", - "image": "dockerfile/redis", + "image": "redis", "ports": [{ "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 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: @@ -78,7 +78,7 @@ You'll see all kubernetes components, most importantly the redis master pod. It ```shell 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: @@ -88,7 +88,7 @@ me@workstation$ gcloud compute ssh kubernetes-minion-7agi me@kubernetes-minion-7agi:~$ sudo docker ps 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. @@ -182,7 +182,7 @@ redis-slave-controller $ kubectl get rc 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 ``` @@ -197,7 +197,7 @@ Once that's up you can list the pods in the cluster, to verify that the master a ```shell $ kubectl get pods 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-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 CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS 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 ``` @@ -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-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 -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-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 ``` diff --git a/guestbook/redis-slave/Dockerfile b/guestbook/redis-slave/Dockerfile index 1ce50fcc..8167438b 100644 --- a/guestbook/redis-slave/Dockerfile +++ b/guestbook/redis-slave/Dockerfile @@ -1,4 +1,4 @@ -FROM dockerfile/redis +FROM redis ADD run.sh /run.sh diff --git a/guestbook/v1beta3/redis-master.json b/guestbook/v1beta3/redis-master.json index cdce5b22..add8ba79 100644 --- a/guestbook/v1beta3/redis-master.json +++ b/guestbook/v1beta3/redis-master.json @@ -22,7 +22,7 @@ "containers":[ { "name":"master", - "image":"dockerfile/redis", + "image":"redis", "ports":[ { "containerPort":6379, diff --git a/k8petstore/redis/Dockerfile b/k8petstore/redis/Dockerfile index 9cebfce4..41ac9dcd 100644 --- a/k8petstore/redis/Dockerfile +++ b/k8petstore/redis/Dockerfile @@ -5,7 +5,7 @@ # # Pull base image. -FROM dockerfile/ubuntu +FROM ubuntu # Install Redis. RUN \ diff --git a/nfs/nfs-web-pod.yaml b/nfs/nfs-web-pod.yaml index efc2841c..f3824f49 100644 --- a/nfs/nfs-web-pod.yaml +++ b/nfs/nfs-web-pod.yaml @@ -9,7 +9,7 @@ metadata: spec: containers: - name: web - image: dockerfile/nginx + image: nginx ports: - name: web containerPort: 80 diff --git a/persistent-volumes/simpletest/pod.yaml b/persistent-volumes/simpletest/pod.yaml index bb76ff4f..aea15022 100644 --- a/persistent-volumes/simpletest/pod.yaml +++ b/persistent-volumes/simpletest/pod.yaml @@ -4,7 +4,7 @@ metadata: name: mypod spec: containers: - - image: dockerfile/nginx + - image: nginx name: myfrontend volumeMounts: - mountPath: "/var/www/html" diff --git a/walkthrough/README.md b/walkthrough/README.md index b2157367..247eacec 100644 --- a/walkthrough/README.md +++ b/walkthrough/README.md @@ -19,7 +19,7 @@ desiredState: id: www containers: - 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. @@ -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. diff --git a/walkthrough/k8s201.md b/walkthrough/k8s201.md index 009dc1f5..5d0627ac 100644 --- a/walkthrough/k8s201.md +++ b/walkthrough/k8s201.md @@ -41,7 +41,7 @@ desiredState: id: nginx containers: - name: nginx - image: dockerfile/nginx + image: nginx ports: - containerPort: 80 # Important: these labels need to match the selector above @@ -135,7 +135,7 @@ desiredState: id: php containers: - name: nginx - image: dockerfile/nginx + image: nginx ports: - containerPort: 80 # defines the health checking diff --git a/walkthrough/pod-with-http-healthcheck.yaml b/walkthrough/pod-with-http-healthcheck.yaml index e2774a64..a49cda10 100644 --- a/walkthrough/pod-with-http-healthcheck.yaml +++ b/walkthrough/pod-with-http-healthcheck.yaml @@ -7,7 +7,7 @@ desiredState: id: php containers: - name: nginx - image: dockerfile/nginx + image: nginx ports: - containerPort: 80 # defines the health checking diff --git a/walkthrough/pod1.yaml b/walkthrough/pod1.yaml index ade2df1c..6fb468a0 100644 --- a/walkthrough/pod1.yaml +++ b/walkthrough/pod1.yaml @@ -7,4 +7,4 @@ desiredState: id: www containers: - name: nginx - image: dockerfile/nginx + image: nginx diff --git a/walkthrough/pod2.yaml b/walkthrough/pod2.yaml index 55a9fb8a..b53d54cb 100644 --- a/walkthrough/pod2.yaml +++ b/walkthrough/pod2.yaml @@ -7,7 +7,7 @@ desiredState: id: storage containers: - name: redis - image: dockerfile/redis + image: redis volumeMounts: # name must match the volume name below - name: redis-persistent-storage diff --git a/walkthrough/replication-controller.yaml b/walkthrough/replication-controller.yaml index 7273b05e..8692d7f4 100644 --- a/walkthrough/replication-controller.yaml +++ b/walkthrough/replication-controller.yaml @@ -16,7 +16,7 @@ desiredState: id: nginx containers: - name: nginx - image: dockerfile/nginx + image: nginx ports: - containerPort: 80 # Important: these labels need to match the selector above diff --git a/walkthrough/v1beta3/README.md b/walkthrough/v1beta3/README.md index 680fc676..cc5d6c7b 100644 --- a/walkthrough/v1beta3/README.md +++ b/walkthrough/v1beta3/README.md @@ -40,7 +40,7 @@ metadata: spec: containers: - name: nginx - image: dockerfile/nginx + image: nginx volumeMounts: - mountPath: /srv/www name: www-data diff --git a/walkthrough/v1beta3/pod-with-http-healthcheck.yaml b/walkthrough/v1beta3/pod-with-http-healthcheck.yaml index 0b6ee183..2cafb147 100644 --- a/walkthrough/v1beta3/pod-with-http-healthcheck.yaml +++ b/walkthrough/v1beta3/pod-with-http-healthcheck.yaml @@ -5,7 +5,7 @@ metadata: spec: containers: - name: nginx - image: dockerfile/nginx + image: nginx # defines the health checking livenessProbe: # an http probe diff --git a/walkthrough/v1beta3/pod1.yaml b/walkthrough/v1beta3/pod1.yaml index 56ae5844..7eefc9ca 100644 --- a/walkthrough/v1beta3/pod1.yaml +++ b/walkthrough/v1beta3/pod1.yaml @@ -5,4 +5,4 @@ metadata: spec: containers: - name: nginx - image: dockerfile/nginx + image: nginx diff --git a/walkthrough/v1beta3/pod2.yaml b/walkthrough/v1beta3/pod2.yaml index c37a0032..f9ce6528 100644 --- a/walkthrough/v1beta3/pod2.yaml +++ b/walkthrough/v1beta3/pod2.yaml @@ -5,7 +5,7 @@ metadata: spec: containers: - name: redis - image: dockerfile/redis + image: redis volumeMounts: # name must match the volume name below - name: redis-persistent-storage diff --git a/walkthrough/v1beta3/replication-controller.yaml b/walkthrough/v1beta3/replication-controller.yaml index 568f2d90..b979a075 100644 --- a/walkthrough/v1beta3/replication-controller.yaml +++ b/walkthrough/v1beta3/replication-controller.yaml @@ -19,6 +19,6 @@ spec: spec: containers: - name: nginx - image: dockerfile/nginx + image: nginx ports: - containerPort: 80