diff --git a/README.md b/README.md index d5c4f78..ca337f9 100644 --- a/README.md +++ b/README.md @@ -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= --param=GIT_REPOSITORY=...,... + oc new-app openshift/templates/django.json -p SOURCE_REPOSITORY_URL= Your application will be built and deployed automatically. If that doesn't happen, you can debug your build: @@ -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 @@ -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 diff --git a/openshift/templates/django-postgresql.json b/openshift/templates/django-postgresql.json index c46476e..64522ce 100644 --- a/openshift/templates/django-postgresql.json +++ b/openshift/templates/django-postgresql.json @@ -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" } @@ -31,7 +31,7 @@ } ], "selector": { - "name": "django-frontend" + "name": "django-postgresql-example" } } }, @@ -39,13 +39,13 @@ "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" } } }, @@ -53,7 +53,7 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "django-example", + "name": "django-postgresql-example", "annotations": { "description": "Keeps track of changes in the application image" } @@ -63,7 +63,7 @@ "kind": "BuildConfig", "apiVersion": "v1", "metadata": { - "name": "django-example", + "name": "django-postgresql-example", "annotations": { "description": "Defines how to build the application" } @@ -90,7 +90,7 @@ "output": { "to": { "kind": "ImageStreamTag", - "name": "django-example:latest" + "name": "django-postgresql-example:latest" } }, "triggers": [ @@ -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" } @@ -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" } } }, @@ -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 @@ -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", diff --git a/openshift/templates/django.json b/openshift/templates/django.json index 74bbea1..1794d19 100644 --- a/openshift/templates/django.json +++ b/openshift/templates/django.json @@ -17,7 +17,7 @@ "kind": "Service", "apiVersion": "v1", "metadata": { - "name": "django-frontend", + "name": "django-example", "annotations": { "description": "Exposes and load balances the application pods" } @@ -31,7 +31,7 @@ } ], "selector": { - "name": "django-frontend" + "name": "django-example" } } }, @@ -39,13 +39,13 @@ "kind": "Route", "apiVersion": "v1", "metadata": { - "name": "django-route" + "name": "django-example" }, "spec": { "host": "${APPLICATION_DOMAIN}", "to": { "kind": "Service", - "name": "django-frontend" + "name": "django-example" } } }, @@ -110,7 +110,7 @@ "kind": "DeploymentConfig", "apiVersion": "v1", "metadata": { - "name": "django-frontend", + "name": "django-example", "annotations": { "description": "Defines how to deploy the application server" } @@ -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": {