django-ex/application-template.json

310 lines
7.5 KiB
JSON
Raw Normal View History

2015-04-29 17:56:59 +02:00
{
"kind": "Template",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 14:07:04 +02:00
"name": "django-quickstart",
2015-04-29 17:56:59 +02:00
"annotations": {
2015-05-22 13:31:14 +02:00
"description": "This is a Django application template that uses PostgreSQL for data storage.",
"tags": "instant-app,python,django,postgresql",
2015-04-29 17:56:59 +02:00
"iconClass" : "icon-python"
}
},
2015-05-22 13:31:14 +02:00
"labels": {
"template": "django-quickstart-sti"
},
"objects": [
2015-04-29 17:56:59 +02:00
{
"kind": "Service",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 13:31:14 +02:00
"name": "${FRONTEND_SERVICE_NAME}",
2015-04-29 17:56:59 +02:00
"annotations": {
"description": "Exposes and load balances the Django app instances."
}
2015-05-22 13:31:14 +02:00
},
"spec": {
"ports": [
{
"name": "web",
"port": 5432,
"targetPort": 8080
}
],
"selector": {
"name": "${FRONTEND_SERVICE_NAME}"
}
2015-04-29 17:56:59 +02:00
}
},
{
"kind": "Service",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 13:31:14 +02:00
"name": "${DATABASE_SERVICE_NAME}",
2015-04-29 17:56:59 +02:00
"annotations": {
"description": "Exposes the PostgreSQL database server."
}
2015-05-22 13:31:14 +02:00
},
"spec": {
"ports": [
{
"name": "postgresql",
"port": 5432,
"targetPort": 5432
}
],
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
}
2015-04-29 17:56:59 +02:00
}
},
{
"kind": "BuildConfig",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 13:31:14 +02:00
"name": "django-quickstart",
2015-04-29 17:56:59 +02:00
"labels": {
2015-05-22 13:31:14 +02:00
"name": "django-quickstart"
2015-04-29 17:56:59 +02:00
},
2015-05-22 13:31:14 +02:00
"annotations": {
"description": "Defines how to build the Django app."
}
},
"spec": {
2015-04-29 17:56:59 +02:00
"source": {
"type": "Git",
"git": {
2015-05-22 13:31:14 +02:00
"uri": "${GIT_REPOSITORY}"
},
"contextDir": "${CONTEXT_DIR}"
2015-04-29 17:56:59 +02:00
},
2015-05-22 13:31:14 +02:00
"strategy": {
"type": "Source",
"SourceStrategy": {
2015-04-29 17:56:59 +02:00
"from": {
"kind": "ImageStream",
2015-04-29 17:56:59 +02:00
"name": "python-33-centos7"
2015-05-22 13:31:14 +02:00
}
2015-04-29 17:56:59 +02:00
}
},
2015-05-22 13:31:14 +02:00
"output": {
"to": {
"kind": "ImageStream",
2015-05-22 13:31:14 +02:00
"name": "django-quickstart"
2015-04-29 17:56:59 +02:00
}
},
2015-05-22 13:31:14 +02:00
"triggers": [
{
2015-05-22 15:31:55 +02:00
"type": "imageChange",
"imageChange": {}
2015-05-22 13:31:14 +02:00
},
{
2015-05-22 15:31:55 +02:00
"type": "github",
2015-05-22 13:31:14 +02:00
"github": {
"secret": "secret123"
}
},
{
2015-05-22 15:31:55 +02:00
"type": "generic",
2015-05-22 13:31:14 +02:00
"generic": {
"secret": "secret123"
}
2015-04-29 17:56:59 +02:00
}
2015-05-22 13:31:14 +02:00
]
}
2015-04-29 17:56:59 +02:00
},
{
"kind": "DeploymentConfig",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 13:31:14 +02:00
"name": "${FRONTEND_SERVICE_NAME}",
2015-04-29 17:56:59 +02:00
"labels": {
2015-05-22 13:31:14 +02:00
"name": "${FRONTEND_SERVICE_NAME}"
2015-04-29 17:56:59 +02:00
},
"annotations": {
"description": "Defines how to deploy the Django app."
}
},
2015-05-22 13:31:14 +02:00
"spec": {
"strategy": {
"type": "Rolling"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"django-quickstart"
],
"from": {
"name": "django-quickstart"
2015-04-29 17:56:59 +02:00
}
}
}
2015-05-22 13:31:14 +02:00
],
"replicas": 2,
"selector": {
"name": "${FRONTEND_SERVICE_NAME}"
2015-04-29 17:56:59 +02:00
},
2015-05-22 13:31:14 +02:00
"template": {
"spec": {
"containers": [
{
"name": "django-quickstart",
"image": "django-quickstart",
"ports": [
{
"containerPort": 8080
}
],
"env": [
{
"name": "APP_MODULE",
"value": "${APP_MODULE}"
},
{
"name": "DJANGO_SECRET_KEY",
"value": "${DJANGO_SECRET_KEY}"
},
{
"name": "DATABASE_URL",
"value": "postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@$DATABASE_SERVICE_HOST:$DATABASE_SERVICE_PORT/${DATABASE_NAME}"
}
2015-04-29 17:56:59 +02:00
]
}
2015-05-22 13:31:14 +02:00
]
2015-04-29 17:56:59 +02:00
}
}
2015-05-22 13:31:14 +02:00
}
2015-04-29 17:56:59 +02:00
},
{
"kind": "DeploymentConfig",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 13:31:14 +02:00
"name": "${DATABASE_SERVICE_NAME}",
"labels": {
"name": "${DATABASE_SERVICE_NAME}"
},
2015-04-29 17:56:59 +02:00
"annotations": {
"description": "Defines how to deploy the database."
}
},
2015-05-22 13:31:14 +02:00
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
},
"template": {
"spec": {
"containers": [
{
"name": "postgresql",
"image": "openshift/postgresql-92-centos7",
"ports": [
2015-04-29 17:56:59 +02:00
{
2015-05-22 13:31:14 +02:00
"containerPort": 5432
}
],
"env": [
{
"name": "POSTGRESQL_USER",
"value": "${DATABASE_USER}"
},
{
"name": "POSTGRESQL_PASSWORD",
"value": "${DATABASE_PASSWORD}"
},
{
"name": "POSTGRESQL_DATABASE",
"value": "${DATABASE_NAME}"
2015-04-29 17:56:59 +02:00
}
]
}
2015-05-22 13:31:14 +02:00
]
2015-04-29 17:56:59 +02:00
}
}
2015-05-22 13:31:14 +02:00
}
2015-04-29 17:56:59 +02:00
},
{
"kind": "ImageStream",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
2015-05-22 13:31:14 +02:00
"name": "django-quickstart",
2015-04-29 17:56:59 +02:00
"annotations": {
2015-05-22 13:31:14 +02:00
"description": "Keeps track of changes in the Django app image."
2015-04-29 17:56:59 +02:00
}
}
},
{
"kind": "ImageStream",
2015-05-22 13:31:14 +02:00
"apiVersion": "v1",
2015-04-29 17:56:59 +02:00
"metadata": {
"name": "python-33-centos7",
"annotations": {
2015-05-22 13:31:14 +02:00
"description": "Keeps track of changes in the Python base image."
2015-04-29 17:56:59 +02:00
}
},
"spec": {
"dockerImageRepository": "openshift/python-33-centos7"
}
}
],
"parameters": [
{
2015-05-22 13:31:14 +02:00
"name": "GIT_REPOSITORY",
2015-04-29 17:56:59 +02:00
"description": "Change this to match your project's Git repository",
"value": "git://github.com/rhcarvalho/openshift-django-quickstart.git"
},
{
2015-05-22 13:31:14 +02:00
"name": "CONTEXT_DIR",
"description": "Change this to the relative path to your project if it is not in the root of your repository",
"value": ""
},
{
2015-04-29 17:56:59 +02:00
"name": "APP_MODULE",
2015-05-22 13:31:14 +02:00
"description": "Python dotted path to your Django WSGI application",
2015-04-29 17:56:59 +02:00
"value": "project.wsgi"
},
2015-05-22 13:31:14 +02:00
{
2015-04-29 17:56:59 +02:00
"name": "DJANGO_SECRET_KEY",
2015-05-22 13:31:14 +02:00
"description": "Django secret key",
2015-04-29 17:56:59 +02:00
"generate": "expression",
"from": "[\\w]{50}"
},
{
"description": "Database name",
"name": "DATABASE_NAME",
"value": "default"
},
{
"description": "Database user name",
"name": "DATABASE_USER",
2015-05-22 13:31:14 +02:00
"value": "django"
2015-04-29 17:56:59 +02:00
},
{
"description": "Database user password",
"name": "DATABASE_PASSWORD",
"generate": "expression",
"from": "[a-zA-Z0-9]{16}"
2015-05-22 13:31:14 +02:00
},
{
"description": "Frontend service name (Django)",
"name": "FRONTEND_SERVICE_NAME",
"value": "web"
},
{
"description": "Database service name (PostgreSQL)",
"name": "DATABASE_SERVICE_NAME",
"value": "database"
2015-04-29 17:56:59 +02:00
}
]
}