|
|
|
@ -2,24 +2,24 @@ |
|
|
|
"kind": "Template", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "django-quickstart-source-postgresql", |
|
|
|
"name": "django-postgresql-example", |
|
|
|
"annotations": { |
|
|
|
"description": "Django application template that uses the Source build strategy and includes a PostgreSQL database server for storage.", |
|
|
|
"description": "An example Django application with a PostgreSQL database", |
|
|
|
"tags": "instant-app,python,django,postgresql", |
|
|
|
"iconClass" : "icon-python" |
|
|
|
"iconClass": "icon-python" |
|
|
|
} |
|
|
|
}, |
|
|
|
"labels": { |
|
|
|
"template": "django-quickstart-source-postgresql" |
|
|
|
"template": "django-postgresql-example" |
|
|
|
}, |
|
|
|
"objects": [ |
|
|
|
{ |
|
|
|
"kind": "Service", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}", |
|
|
|
"name": "django-frontend", |
|
|
|
"annotations": { |
|
|
|
"description": "Exposes and load balances the Django app instances." |
|
|
|
"description": "Exposes and load balances the application pods" |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
@ -31,60 +31,48 @@ |
|
|
|
} |
|
|
|
], |
|
|
|
"selector": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}" |
|
|
|
"name": "django-frontend" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "Service", |
|
|
|
"kind": "Route", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "${DATABASE_SERVICE_NAME}", |
|
|
|
"annotations": { |
|
|
|
"description": "Exposes the PostgreSQL database server." |
|
|
|
} |
|
|
|
"name": "django-route" |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
"ports": [ |
|
|
|
{ |
|
|
|
"name": "postgresql", |
|
|
|
"port": 5432, |
|
|
|
"targetPort": 5432 |
|
|
|
} |
|
|
|
], |
|
|
|
"selector": { |
|
|
|
"name": "${DATABASE_SERVICE_NAME}" |
|
|
|
"host": "${FRONTEND_ROUTE}", |
|
|
|
"to": { |
|
|
|
"kind": "Service", |
|
|
|
"name": "django-frontend" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "Route", |
|
|
|
"kind": "ImageStream", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}-route" |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
"host" : "${FRONTEND_ROUTE}", |
|
|
|
"to": { |
|
|
|
"kind" : "Service", |
|
|
|
"name" : "${FRONTEND_SERVICE_NAME}" |
|
|
|
} |
|
|
|
"name": "django-example", |
|
|
|
"annotations": { |
|
|
|
"description": "Keeps track of changes in the application image" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "BuildConfig", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "django-quickstart-source", |
|
|
|
"name": "django-example", |
|
|
|
"annotations": { |
|
|
|
"description": "Defines how to build the Django app." |
|
|
|
"description": "Defines how to build the application" |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
"source": { |
|
|
|
"type": "Git", |
|
|
|
"git": { |
|
|
|
"uri": "${GIT_REPOSITORY}" |
|
|
|
"uri": "${SOURCE_REPOSITORY_URL}" |
|
|
|
}, |
|
|
|
"contextDir": "${CONTEXT_DIR}" |
|
|
|
}, |
|
|
|
@ -92,15 +80,16 @@ |
|
|
|
"type": "Source", |
|
|
|
"sourceStrategy": { |
|
|
|
"from": { |
|
|
|
"kind": "ImageStream", |
|
|
|
"name": "python-33-centos7" |
|
|
|
"kind": "ImageStreamTag", |
|
|
|
"namespace": "openshift", |
|
|
|
"name": "python:3.3" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
"output": { |
|
|
|
"to": { |
|
|
|
"kind": "ImageStream", |
|
|
|
"name": "django-quickstart-source" |
|
|
|
"name": "django-example" |
|
|
|
} |
|
|
|
}, |
|
|
|
"triggers": [ |
|
|
|
@ -110,13 +99,7 @@ |
|
|
|
{ |
|
|
|
"type": "GitHub", |
|
|
|
"github": { |
|
|
|
"secret": "secret123" |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"type": "Generic", |
|
|
|
"generic": { |
|
|
|
"secret": "secret123" |
|
|
|
"secret": "${GITHUB_WEBHOOK_SECRET}" |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
@ -126,9 +109,9 @@ |
|
|
|
"kind": "DeploymentConfig", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}", |
|
|
|
"name": "django-frontend", |
|
|
|
"annotations": { |
|
|
|
"description": "Defines how to deploy the Django app." |
|
|
|
"description": "Defines how to deploy the application server" |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
@ -141,10 +124,11 @@ |
|
|
|
"imageChangeParams": { |
|
|
|
"automatic": true, |
|
|
|
"containerNames": [ |
|
|
|
"django-quickstart" |
|
|
|
"django-example" |
|
|
|
], |
|
|
|
"from": { |
|
|
|
"name": "django-quickstart-source:latest" |
|
|
|
"kind": "ImageStreamTag", |
|
|
|
"name": "django-example:latest" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -154,20 +138,20 @@ |
|
|
|
], |
|
|
|
"replicas": 1, |
|
|
|
"selector": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}" |
|
|
|
"name": "django-frontend" |
|
|
|
}, |
|
|
|
"template": { |
|
|
|
"metadata": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}", |
|
|
|
"name": "django-frontend", |
|
|
|
"labels": { |
|
|
|
"name": "${FRONTEND_SERVICE_NAME}" |
|
|
|
"name": "django-frontend" |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
"containers": [ |
|
|
|
{ |
|
|
|
"name": "django-quickstart", |
|
|
|
"image": "django-quickstart-source", |
|
|
|
"name": "django-example", |
|
|
|
"image": "django-example", |
|
|
|
"ports": [ |
|
|
|
{ |
|
|
|
"containerPort": 8080 |
|
|
|
@ -210,15 +194,34 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "DeploymentConfig", |
|
|
|
"kind": "Service", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "${DATABASE_SERVICE_NAME}", |
|
|
|
"labels": { |
|
|
|
"annotations": { |
|
|
|
"description": "Exposes the database server" |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
"ports": [ |
|
|
|
{ |
|
|
|
"name": "postgresql", |
|
|
|
"port": 5432, |
|
|
|
"targetPort": 5432 |
|
|
|
} |
|
|
|
], |
|
|
|
"selector": { |
|
|
|
"name": "${DATABASE_SERVICE_NAME}" |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "DeploymentConfig", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "${DATABASE_SERVICE_NAME}", |
|
|
|
"annotations": { |
|
|
|
"description": "Defines how to deploy the database." |
|
|
|
"description": "Defines how to deploy the database" |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
@ -270,50 +273,28 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "ImageStream", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "django-quickstart-source", |
|
|
|
"annotations": { |
|
|
|
"description": "Keeps track of changes in the Django app image." |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"kind": "ImageStream", |
|
|
|
"apiVersion": "v1", |
|
|
|
"metadata": { |
|
|
|
"name": "python-33-centos7", |
|
|
|
"annotations": { |
|
|
|
"description": "Keeps track of changes in the Python base image." |
|
|
|
} |
|
|
|
}, |
|
|
|
"spec": { |
|
|
|
"dockerImageRepository": "openshift/python-33-centos7" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
"parameters": [ |
|
|
|
{ |
|
|
|
"name": "GIT_REPOSITORY", |
|
|
|
"description": "Change this to match your project's Git repository", |
|
|
|
"value": "git://github.com/openshift/django-ex.git" |
|
|
|
"name": "SOURCE_REPOSITORY_URL", |
|
|
|
"description": "The URL of the repository with your application source code", |
|
|
|
"value": "https://github.com/openshift/django-ex.git" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "CONTEXT_DIR", |
|
|
|
"description": "Set this to the relative path to your project if it is not in the root of your repository" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "FRONTEND_SERVICE_NAME", |
|
|
|
"description": "Frontend service name", |
|
|
|
"value": "django" |
|
|
|
"name": "FRONTEND_ROUTE", |
|
|
|
"description": "The exposed hostname that will route to the Django service", |
|
|
|
"value": "django.app" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "FRONTEND_ROUTE", |
|
|
|
"description": "The exposed hostname that will route to the frontend service", |
|
|
|
"value": "django-frontend.apps" |
|
|
|
"name": "GITHUB_WEBHOOK_SECRET", |
|
|
|
"description": "A secret string used to configure the GitHub webhook", |
|
|
|
"generate": "expression", |
|
|
|
"from": "[a-zA-Z0-9]{40}" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "DATABASE_SERVICE_NAME", |
|
|
|
|