Update examples/phabricator for v1beta3

This commit is contained in:
BC Broussard 2015-04-23 08:27:25 -07:00
parent f9156c281a
commit 715bee6b3a
4 changed files with 160 additions and 116 deletions

View File

@ -15,7 +15,7 @@ $ hack/dev-build-and-up.sh
### Step One: Set up Cloud SQL instance ### Step One: Set up Cloud SQL instance
Follow the [official instructions](https://cloud.google.com/sql/docs/getting-started) to set up Cloud SQL instance. Follow the [official instructions](https://cloud.google.com/sql/docs/getting-started) to set up Cloud SQL instance.
In the remaining part of this example we will assume that your instance is named "phabricator-db", has IP 173.194.242.66 and the password is "1234". In the remaining part of this example we will assume that your instance is named "phabricator-db", has IP 173.194.242.66 and the password is "1234".
@ -25,34 +25,41 @@ To start Phabricator server use the file `examples/phabricator/phabricator-contr
```js ```js
{ {
"id": "phabricator-controller",
"kind": "ReplicationController", "kind": "ReplicationController",
"apiVersion": "v1beta1", "apiVersion": "v1beta3",
"desiredState": { "metadata": {
"replicas": 1, "name": "phabricator-controller",
"replicaSelector": {"name": "phabricator"}, "labels": {
"podTemplate": { "name": "phabricator"
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "phabricator-pod",
"containers": [{
"name": "phabricator",
"image": "kubernetes/example-php-phabricator",
"env": [
{"name": "MYSQL_SERVICE_IP", "value": "173.194.242.66"},
{"name": "MYSQL_SERVICE_PORT", "value": "3306"},
{"name": "MYSQL_PASSWORD", "value": "1234"},
],
"ports": [{"name": "http-server", "containerPort": 80}],
"imagePullPolicy": "Always"
}]
}
},
"labels": { "name": "phabricator" }
} }
}, },
"labels": {"name": "phabricator"} "spec": {
"replicas": 1,
"selector": {
"name": "phabricator"
},
"template": {
"metadata": {
"labels": {
"name": "phabricator"
}
},
"spec": {
"containers": [
{
"name": "phabricator",
"image": "fgrzadkowski/example-php-phabricator",
"ports": [
{
"name": "http-server",
"containerPort": 80
}
]
}
]
}
}
}
} }
``` ```
@ -82,7 +89,7 @@ me@workstation$ gcloud compute ssh --zone us-central1-b kubernetes-minion-2
$ sudo docker ps $ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
54983bc33494 fgrzadkowski/phabricator:latest "/run.sh" 2 hours ago Up 2 hours k8s_phabricator.d6b45054_phabricator-controller-02qp4.default.api_eafb1e53-b6a9-11e4-b1ae-42010af05ea6_01c2c4ca 54983bc33494 fgrzadkowski/phabricator:latest "/run.sh" 2 hours ago Up 2 hours k8s_phabricator.d6b45054_phabricator-controller-02qp4.default.api_eafb1e53-b6a9-11e4-b1ae-42010af05ea6_01c2c4ca
``` ```
(Note that initial `docker pull` may take a few minutes, depending on network conditions. During this time, the `get pods` command will return `Pending` because the container has not yet started ) (Note that initial `docker pull` may take a few minutes, depending on network conditions. During this time, the `get pods` command will return `Pending` because the container has not yet started )
@ -110,34 +117,37 @@ To automate this process and make sure that a proper host is authorized even if
```js ```js
{ {
"id": "authenticator-controller",
"kind": "ReplicationController", "kind": "ReplicationController",
"apiVersion": "v1beta1", "apiVersion": "v1beta3",
"desiredState": { "metadata": {
"replicas": 1, "name": "authenticator-controller",
"replicaSelector": {"name": "authenticator"}, "labels": {
"podTemplate": { "name": "authenticator"
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "authenticator-pod",
"containers": [{
"name": "authenticator",
"image": "kubernetes/example-cloudsql-authenticator",
"env": [
{"name": "SELECTOR", "value": "name=phabricator"},
{"name": "CLOUDSQL_DB", "value": "phabricator-db"}
],
"imagePullPolicy": "Always"
}],
}
},
"labels": { "name": "authenticator" }
} }
}, },
"labels": {"name": "authenticator"} "spec": {
"replicas": 1,
"selector": {
"name": "authenticator"
},
"template": {
"metadata": {
"labels": {
"name": "authenticator"
}
},
"spec": {
"containers": [
{
"name": "authenticator",
"image": "fgrzadkowski/example-cloudsql-authenticator"
}
]
}
}
}
} }
``` ```
To create the pod run: To create the pod run:
@ -163,14 +173,26 @@ Use the file `examples/phabricator/phabricator-service.json`:
```js ```js
{ {
"apiVersion": "v1beta1",
"kind": "Service", "kind": "Service",
"id": "phabricator", "apiVersion": "v1beta3",
"port": 80, "metadata": {
"containerPort": "http-server", "name": "phabricator"
"selector": { "name": "phabricator" }, },
"createExternalLoadBalancer": true, "spec": {
"publicIPs": ["107.178.210.6"] "ports": [
{
"port": 80,
"targetPort": "http-server"
}
],
"selector": {
"name": "phabricator"
},
"createExternalLoadBalancer": true,
"publicIPs": [
"107.178.210.6"
]
}
} }
``` ```

View File

@ -1,28 +1,31 @@
{ {
"id": "authenticator-controller",
"kind": "ReplicationController", "kind": "ReplicationController",
"apiVersion": "v1beta1", "apiVersion": "v1beta3",
"desiredState": { "metadata": {
"replicas": 1, "name": "authenticator-controller",
"replicaSelector": {"name": "authenticator"}, "labels": {
"podTemplate": { "name": "authenticator"
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "authenticator-pod",
"containers": [{
"name": "authenticator",
"image": "fgrzadkowski/example-cloudsql-authenticator",
"env": [
{"name": "SELECTOR", "value": "name=phabricator"},
{"name": "CLOUDSQL_DB", "value": "phabricator-db"}
],
"imagePullPolicy": "Always"
}]
}
},
"labels": { "name": "authenticator" }
} }
}, },
"labels": {"name": "authenticator"} "spec": {
} "replicas": 1,
"selector": {
"name": "authenticator"
},
"template": {
"metadata": {
"labels": {
"name": "authenticator"
}
},
"spec": {
"containers": [
{
"name": "authenticator",
"image": "fgrzadkowski/example-cloudsql-authenticator"
}
]
}
}
}
}

View File

@ -1,30 +1,37 @@
{ {
"id": "phabricator-controller",
"kind": "ReplicationController", "kind": "ReplicationController",
"apiVersion": "v1beta1", "apiVersion": "v1beta3",
"desiredState": { "metadata": {
"replicas": 1, "name": "phabricator-controller",
"replicaSelector": {"name": "phabricator"}, "labels": {
"podTemplate": { "name": "phabricator"
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "phabricator-pod",
"containers": [{
"name": "phabricator",
"image": "fgrzadkowski/example-php-phabricator",
"env": [
{"name": "MYSQL_SERVICE_IP", "value": "173.194.242.66"},
{"name": "MYSQL_SERVICE_PORT", "value": "3306"},
{"name": "MYSQL_PASSWORD", "value": "1234"}
],
"ports": [{"name": "http-server", "containerPort": 80}],
"imagePullPolicy": "Always"
}]
}
},
"labels": { "name": "phabricator" }
} }
}, },
"labels": {"name": "phabricator"} "spec": {
} "replicas": 1,
"selector": {
"name": "phabricator"
},
"template": {
"metadata": {
"labels": {
"name": "phabricator"
}
},
"spec": {
"containers": [
{
"name": "phabricator",
"image": "fgrzadkowski/example-php-phabricator",
"ports": [
{
"name": "http-server",
"containerPort": 80
}
]
}
]
}
}
}
}

View File

@ -1,10 +1,22 @@
{ {
"apiVersion": "v1beta1",
"kind": "Service", "kind": "Service",
"id": "phabricator", "apiVersion": "v1beta3",
"port": 80, "metadata": {
"containerPort": "http-server", "name": "phabricator"
"selector": { "name": "phabricator" }, },
"createExternalLoadBalancer": true, "spec": {
"publicIPs": ["107.178.210.6"] "ports": [
} {
"port": 80,
"targetPort": "http-server"
}
],
"selector": {
"name": "phabricator"
},
"createExternalLoadBalancer": true,
"publicIPs": [
"107.178.210.6"
]
}
}