apply changes

This commit is contained in:
Daniel Smith
2015-07-16 19:01:02 -07:00
parent 2a112a0004
commit f7873d2a1f
91 changed files with 530 additions and 7 deletions

View File

@@ -62,6 +62,7 @@ gcloud config set project <project-name>
```
Next, start up a Kubernetes cluster:
```shell
wget -q -O - https://get.k8s.io | bash
```
@@ -81,6 +82,7 @@ files to your existing Meteor project `Dockerfile` and
`Dockerfile` should contain the below lines. You should replace the
`ROOT_URL` with the actual hostname of your app.
```
FROM chees/meteor-kubernetes
ENV ROOT_URL http://myawesomeapp.com
@@ -89,6 +91,7 @@ ENV ROOT_URL http://myawesomeapp.com
The `.dockerignore` file should contain the below lines. This tells
Docker to ignore the files on those directories when it's building
your container.
```
.meteor/local
packages/*/.build*
@@ -103,6 +106,7 @@ free to use this app for this example.
Now you can build your container by running this in
your Meteor project directory:
```
docker build -t my-meteor .
```
@@ -113,6 +117,7 @@ Pushing to a registry
For the [Docker Hub](https://hub.docker.com/), tag your app image with
your username and push to the Hub with the below commands. Replace
`<username>` with your Hub username.
```
docker tag my-meteor <username>/my-meteor
docker push <username>/my-meteor
@@ -122,6 +127,7 @@ For [Google Container
Registry](https://cloud.google.com/tools/container-registry/), tag
your app image with your project ID, and push to GCR. Replace
`<project>` with your project ID.
```
docker tag my-meteor gcr.io/<project>/my-meteor
gcloud docker push gcr.io/<project>/my-meteor
@@ -139,17 +145,20 @@ We will need to provide MongoDB a persistent Kuberetes volume to
store its data. See the [volumes documentation](../../docs/user-guide/volumes.md) for
options. We're going to use Google Compute Engine persistent
disks. Create the MongoDB disk by running:
```
gcloud compute disks create --size=200GB mongo-disk
```
Now you can start Mongo using that disk:
```
kubectl create -f examples/meteor/mongo-pod.json
kubectl create -f examples/meteor/mongo-service.json
```
Wait until Mongo is started completely and then start up your Meteor app:
```
kubectl create -f examples/meteor/meteor-controller.json
kubectl create -f examples/meteor/meteor-service.json
@@ -159,12 +168,14 @@ Note that [`meteor-service.json`](meteor-service.json) creates a load balancer,
your app should be available through the IP of that load balancer once
the Meteor pods are started. You can find the IP of your load balancer
by running:
```
kubectl get services/meteor --template="{{range .status.loadBalancer.ingress}} {{.ip}} {{end}}"
```
You will have to open up port 80 if it's not open yet in your
environment. On Google Compute Engine, you may run the below command.
```
gcloud compute firewall-rules create meteor-80 --allow=tcp:80 --target-tags kubernetes-minion
```
@@ -179,6 +190,7 @@ to get an insight of what happens during the `docker build` step. The
image is based on the Node.js official image. It then installs Meteor
and copies in your apps' code. The last line specifies what happens
when your app container is run.
```
ENTRYPOINT MONGO_URL=mongodb://$MONGO_SERVICE_HOST:$MONGO_SERVICE_PORT /usr/local/bin/node main.js
```
@@ -201,6 +213,7 @@ more information.
As mentioned above, the mongo container uses a volume which is mapped
to a persistent disk by Kubernetes. In [`mongo-pod.json`](mongo-pod.json) the container
section specifies the volume:
```
"volumeMounts": [
{
@@ -211,6 +224,7 @@ section specifies the volume:
The name `mongo-disk` refers to the volume specified outside the
container section:
```
"volumes": [
{