Skip to content

Commit

Permalink
Merge pull request #21 from gabemontero/issue3358
Browse files Browse the repository at this point in the history
get names consistent; associated doc updates based on test walkthrough
  • Loading branch information
bparees committed Jul 1, 2015
2 parents d89bae6 + 9cf2c50 commit c84b9f8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ After adding your templates, you can go to your OpenShift web console, browse to

Adjust the parameter values to suit your configuration. Most times you can just accept the default values, however you will probably want to set the `GIT_REPOSITORY` parameter to point to your fork and the `DATABASE_*` parameters to match your database configuration.

Alternatively, you can use the command line to create your new app:
Alternatively, you can use the command line to create your new app, assuming your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available [here](http://docs.openshift.org/latest/admin_guide/install/first_steps.html). If you are defining the set of ImageStreams now, remember to pass in the proper cluster-admin credentials and to create the ImageStreams in the 'openshift' namespace:

oc new-app --template=<TEMPLATE_NAME> --param=GIT_REPOSITORY=...,...
oc new-app openshift/templates/django.json -p SOURCE_REPOSITORY_URL=<your repository location>

Your application will be built and deployed automatically. If that doesn't happen, you can debug your build:

Expand All @@ -92,9 +92,11 @@ Your application will be built and deployed automatically. If that doesn't happe

And you can see information about your deployment too:

oc describe dc/django
oc describe dc/django-example

In the web console, the overview tab shows you a service, by default called "django", that encapsulates all pods running your Django application. You can access your application by browsing to the service's IP address and port.
In the web console, the overview tab shows you a service, by default called "django-example", that encapsulates all pods running your Django application. You can access your application by browsing to the service's IP address and port. You can determine these by running

oc get svc


### Without an application template
Expand Down Expand Up @@ -185,7 +187,7 @@ If there is more than one replica, you can also specify a POD by index:

Or both together:

POD_NAME=frontend POD_INDEX=2 ./run-in-container.sh ./manage.py shell
POD_NAME=django-example POD_INDEX=2 ./run-in-container.sh ./manage.py shell


## Data persistence
Expand Down
32 changes: 16 additions & 16 deletions openshift/templates/django-postgresql.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "django-frontend",
"name": "django-postgresql-example",
"annotations": {
"description": "Exposes and load balances the application pods"
}
Expand All @@ -31,29 +31,29 @@
}
],
"selector": {
"name": "django-frontend"
"name": "django-postgresql-example"
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "django-route"
"name": "django-postgresql-example"
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
"name": "django-frontend"
"name": "django-postgresql-example"
}
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "django-example",
"name": "django-postgresql-example",
"annotations": {
"description": "Keeps track of changes in the application image"
}
Expand All @@ -63,7 +63,7 @@
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "django-example",
"name": "django-postgresql-example",
"annotations": {
"description": "Defines how to build the application"
}
Expand All @@ -90,7 +90,7 @@
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "django-example:latest"
"name": "django-postgresql-example:latest"
}
},
"triggers": [
Expand All @@ -110,7 +110,7 @@
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "django-frontend",
"name": "django-postgresql-example",
"annotations": {
"description": "Defines how to deploy the application server"
}
Expand All @@ -125,11 +125,11 @@
"imageChangeParams": {
"automatic": true,
"containerNames": [
"django-example"
"django-postgresql-example"
],
"from": {
"kind": "ImageStreamTag",
"name": "django-example:latest"
"name": "django-postgresql-example:latest"
}
}
},
Expand All @@ -139,20 +139,20 @@
],
"replicas": 1,
"selector": {
"name": "django-frontend"
"name": "django-postgresql-example"
},
"template": {
"metadata": {
"name": "django-frontend",
"name": "django-postgresql-example",
"labels": {
"name": "django-frontend"
"name": "django-postgresql-example"
}
},
"spec": {
"containers": [
{
"name": "django-example",
"image": "django-example",
"name": "django-postgresql-example",
"image": "django-postgresql-example",
"ports": [
{
"containerPort": 8080
Expand Down Expand Up @@ -293,7 +293,7 @@
{
"name": "APPLICATION_DOMAIN",
"description": "The exposed hostname that will route to the Django service",
"value": "django-example.openshiftapps.com"
"value": "django-postgresql-example.openshiftapps.com"
},
{
"name": "GITHUB_WEBHOOK_SECRET",
Expand Down
16 changes: 8 additions & 8 deletions openshift/templates/django.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "django-frontend",
"name": "django-example",
"annotations": {
"description": "Exposes and load balances the application pods"
}
Expand All @@ -31,21 +31,21 @@
}
],
"selector": {
"name": "django-frontend"
"name": "django-example"
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "django-route"
"name": "django-example"
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
"name": "django-frontend"
"name": "django-example"
}
}
},
Expand Down Expand Up @@ -110,7 +110,7 @@
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "django-frontend",
"name": "django-example",
"annotations": {
"description": "Defines how to deploy the application server"
}
Expand Down Expand Up @@ -139,13 +139,13 @@
],
"replicas": 1,
"selector": {
"name": "django-frontend"
"name": "django-example"
},
"template": {
"metadata": {
"name": "django-frontend",
"name": "django-example",
"labels": {
"name": "django-frontend"
"name": "django-example"
}
},
"spec": {
Expand Down

0 comments on commit c84b9f8

Please sign in to comment.