2015-04-29 17:56:59 +02:00
|
|
|
{
|
|
|
|
"kind": "Template",
|
2015-06-11 17:19:47 +02:00
|
|
|
"apiVersion": "v1",
|
2015-04-29 17:56:59 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
2015-04-29 17:56:59 +02:00
|
|
|
"annotations": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"description": "An example Django application with a PostgreSQL database",
|
2015-05-22 13:31:14 +02:00
|
|
|
"tags": "instant-app,python,django,postgresql",
|
2015-06-11 21:05:29 +02:00
|
|
|
"iconClass": "icon-python"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"labels": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"template": "django-psql-example"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
|
|
|
"objects": [
|
2015-04-29 17:56:59 +02:00
|
|
|
{
|
|
|
|
"kind": "Service",
|
2015-06-11 17:19:47 +02:00
|
|
|
"apiVersion": "v1",
|
2015-04-29 17:56:59 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
2015-04-29 17:56:59 +02:00
|
|
|
"annotations": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"description": "Exposes and load balances the application pods"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"name": "web",
|
2015-06-01 18:37:01 +02:00
|
|
|
"port": 8080,
|
2015-05-22 13:31:14 +02:00
|
|
|
"targetPort": 8080
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"selector": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example"
|
2015-05-22 13:31:14 +02:00
|
|
|
}
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2015-06-11 21:05:29 +02:00
|
|
|
"kind": "Route",
|
2015-06-11 17:19:47 +02:00
|
|
|
"apiVersion": "v1",
|
2015-04-29 17:56:59 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
|
|
|
"spec": {
|
2015-06-16 18:45:38 +02:00
|
|
|
"host": "${APPLICATION_DOMAIN}",
|
2015-06-11 21:05:29 +02:00
|
|
|
"to": {
|
|
|
|
"kind": "Service",
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example"
|
2015-05-22 13:31:14 +02:00
|
|
|
}
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
},
|
2015-06-08 21:31:12 +02:00
|
|
|
{
|
2015-06-11 21:05:29 +02:00
|
|
|
"kind": "ImageStream",
|
2015-06-11 17:19:47 +02:00
|
|
|
"apiVersion": "v1",
|
2015-06-08 21:31:12 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
2015-06-11 21:05:29 +02:00
|
|
|
"annotations": {
|
|
|
|
"description": "Keeps track of changes in the application image"
|
|
|
|
}
|
2015-06-08 21:31:12 +02:00
|
|
|
}
|
|
|
|
},
|
2015-04-29 17:56:59 +02:00
|
|
|
{
|
|
|
|
"kind": "BuildConfig",
|
2015-06-11 17:19:47 +02:00
|
|
|
"apiVersion": "v1",
|
2015-04-29 17:56:59 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
2015-05-22 13:31:14 +02:00
|
|
|
"annotations": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"description": "Defines how to build the application"
|
2015-05-22 13:31:14 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
2015-04-29 17:56:59 +02:00
|
|
|
"source": {
|
|
|
|
"type": "Git",
|
|
|
|
"git": {
|
2015-06-16 12:07:49 +02:00
|
|
|
"uri": "${SOURCE_REPOSITORY_URL}",
|
|
|
|
"ref": "${SOURCE_REPOSITORY_REF}"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
|
|
|
"contextDir": "${CONTEXT_DIR}"
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"strategy": {
|
|
|
|
"type": "Source",
|
2015-05-24 21:07:24 +02:00
|
|
|
"sourceStrategy": {
|
2015-04-29 17:56:59 +02:00
|
|
|
"from": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"kind": "ImageStreamTag",
|
|
|
|
"namespace": "openshift",
|
2015-11-21 00:26:32 +01:00
|
|
|
"name": "python:3.4"
|
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": {
|
2015-06-16 11:53:41 +02:00
|
|
|
"kind": "ImageStreamTag",
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example:latest"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"triggers": [
|
|
|
|
{
|
2015-06-11 17:19:47 +02:00
|
|
|
"type": "ImageChange"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
2015-11-21 00:26:32 +01:00
|
|
|
{
|
|
|
|
"type": "ConfigChange"
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
{
|
2015-06-11 17:19:47 +02:00
|
|
|
"type": "GitHub",
|
2015-05-22 13:31:14 +02:00
|
|
|
"github": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"secret": "${GITHUB_WEBHOOK_SECRET}"
|
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-06-11 17:19:47 +02:00
|
|
|
"apiVersion": "v1",
|
2015-04-29 17:56:59 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
2015-04-29 17:56:59 +02:00
|
|
|
"annotations": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"description": "Defines how to deploy the application server"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"spec": {
|
|
|
|
"strategy": {
|
|
|
|
"type": "Rolling"
|
|
|
|
},
|
|
|
|
"triggers": [
|
|
|
|
{
|
|
|
|
"type": "ImageChange",
|
|
|
|
"imageChangeParams": {
|
|
|
|
"automatic": true,
|
|
|
|
"containerNames": [
|
2015-07-31 15:32:39 +02:00
|
|
|
"django-psql-example"
|
2015-05-22 13:31:14 +02:00
|
|
|
],
|
|
|
|
"from": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"kind": "ImageStreamTag",
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example:latest"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
}
|
2015-05-25 22:31:57 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "ConfigChange"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
2015-05-22 13:31:14 +02:00
|
|
|
],
|
2015-06-01 18:37:01 +02:00
|
|
|
"replicas": 1,
|
2015-05-22 13:31:14 +02:00
|
|
|
"selector": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example"
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"template": {
|
2015-05-22 15:33:35 +02:00
|
|
|
"metadata": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
2015-05-22 15:33:35 +02:00
|
|
|
"labels": {
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example"
|
2015-05-22 15:33:35 +02:00
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"spec": {
|
|
|
|
"containers": [
|
|
|
|
{
|
2015-07-31 15:32:39 +02:00
|
|
|
"name": "django-psql-example",
|
|
|
|
"image": "django-psql-example",
|
2015-05-22 13:31:14 +02:00
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"containerPort": 8080
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"env": [
|
|
|
|
{
|
2015-06-01 18:37:01 +02:00
|
|
|
"name": "DATABASE_SERVICE_NAME",
|
|
|
|
"value": "${DATABASE_SERVICE_NAME}"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
2015-05-22 16:38:15 +02:00
|
|
|
{
|
2015-06-01 18:37:01 +02:00
|
|
|
"name": "DATABASE_ENGINE",
|
|
|
|
"value": "${DATABASE_ENGINE}"
|
2015-05-22 16:38:15 +02:00
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
{
|
2015-06-01 18:37:01 +02:00
|
|
|
"name": "DATABASE_NAME",
|
|
|
|
"value": "${DATABASE_NAME}"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
|
|
|
{
|
2015-05-22 15:34:11 +02:00
|
|
|
"name": "DATABASE_USER",
|
|
|
|
"value": "${DATABASE_USER}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_PASSWORD",
|
|
|
|
"value": "${DATABASE_PASSWORD}"
|
|
|
|
},
|
2015-06-01 18:37:01 +02:00
|
|
|
{
|
|
|
|
"name": "APP_CONFIG",
|
|
|
|
"value": "${APP_CONFIG}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DJANGO_SECRET_KEY",
|
|
|
|
"value": "${DJANGO_SECRET_KEY}"
|
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
|
|
|
}
|
|
|
|
}
|
2015-05-22 13:31:14 +02:00
|
|
|
}
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
|
|
|
{
|
2015-06-11 21:05:29 +02:00
|
|
|
"kind": "Service",
|
2015-06-11 17:19:47 +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-06-11 21:05:29 +02:00
|
|
|
"annotations": {
|
|
|
|
"description": "Exposes the database server"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"name": "postgresql",
|
|
|
|
"port": 5432,
|
|
|
|
"targetPort": 5432
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"selector": {
|
2015-05-22 13:31:14 +02:00
|
|
|
"name": "${DATABASE_SERVICE_NAME}"
|
2015-06-11 21:05:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kind": "DeploymentConfig",
|
|
|
|
"apiVersion": "v1",
|
|
|
|
"metadata": {
|
|
|
|
"name": "${DATABASE_SERVICE_NAME}",
|
2015-04-29 17:56:59 +02:00
|
|
|
"annotations": {
|
2015-06-11 21:05:29 +02:00
|
|
|
"description": "Defines how to deploy the database"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"spec": {
|
|
|
|
"strategy": {
|
|
|
|
"type": "Recreate"
|
|
|
|
},
|
|
|
|
"triggers": [
|
2015-11-21 00:26:32 +01:00
|
|
|
{
|
|
|
|
"type": "ImageChange",
|
|
|
|
"imageChangeParams": {
|
|
|
|
"automatic": false,
|
|
|
|
"containerNames": [
|
|
|
|
"postgresql"
|
|
|
|
],
|
|
|
|
"from": {
|
|
|
|
"kind": "ImageStreamTag",
|
2015-11-21 04:42:35 +01:00
|
|
|
"namespace": "openshift",
|
2015-11-21 00:26:32 +01:00
|
|
|
"name": "postgresql:9.4"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
{
|
|
|
|
"type": "ConfigChange"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"replicas": 1,
|
|
|
|
"selector": {
|
|
|
|
"name": "${DATABASE_SERVICE_NAME}"
|
|
|
|
},
|
|
|
|
"template": {
|
2015-05-22 15:33:35 +02:00
|
|
|
"metadata": {
|
|
|
|
"name": "${DATABASE_SERVICE_NAME}",
|
|
|
|
"labels": {
|
|
|
|
"name": "${DATABASE_SERVICE_NAME}"
|
|
|
|
}
|
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
"spec": {
|
|
|
|
"containers": [
|
|
|
|
{
|
|
|
|
"name": "postgresql",
|
2015-11-21 00:26:32 +01:00
|
|
|
"image": "postgresql",
|
2015-05-22 13:31:14 +02:00
|
|
|
"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
|
|
|
}
|
|
|
|
],
|
|
|
|
"parameters": [
|
|
|
|
{
|
2015-06-11 21:05:29 +02:00
|
|
|
"name": "SOURCE_REPOSITORY_URL",
|
|
|
|
"description": "The URL of the repository with your application source code",
|
|
|
|
"value": "https://github.com/openshift/django-ex.git"
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
2015-06-16 12:07:49 +02:00
|
|
|
{
|
|
|
|
"name": "SOURCE_REPOSITORY_REF",
|
|
|
|
"description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch"
|
|
|
|
},
|
2015-04-29 17:56:59 +02:00
|
|
|
{
|
2015-05-22 13:31:14 +02:00
|
|
|
"name": "CONTEXT_DIR",
|
2015-06-01 18:37:01 +02:00
|
|
|
"description": "Set this to the relative path to your project if it is not in the root of your repository"
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
2015-05-22 16:38:15 +02:00
|
|
|
{
|
2015-06-16 18:45:38 +02:00
|
|
|
"name": "APPLICATION_DOMAIN",
|
2015-08-18 19:19:30 +02:00
|
|
|
"description": "The exposed hostname that will route to the Django service, if left blank a value will be defaulted.",
|
|
|
|
"value": ""
|
2015-05-22 16:38:15 +02:00
|
|
|
},
|
2015-06-08 21:31:12 +02:00
|
|
|
{
|
2015-06-11 21:05:29 +02:00
|
|
|
"name": "GITHUB_WEBHOOK_SECRET",
|
|
|
|
"description": "A secret string used to configure the GitHub webhook",
|
|
|
|
"generate": "expression",
|
|
|
|
"from": "[a-zA-Z0-9]{40}"
|
2015-06-08 21:31:12 +02:00
|
|
|
},
|
2015-05-22 13:31:14 +02:00
|
|
|
{
|
2015-06-01 18:37:01 +02:00
|
|
|
"name": "DATABASE_SERVICE_NAME",
|
2015-06-02 16:17:58 +02:00
|
|
|
"description": "Database service name",
|
|
|
|
"value": "postgresql"
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
2015-06-02 16:19:11 +02:00
|
|
|
{
|
|
|
|
"name": "DATABASE_ENGINE",
|
|
|
|
"description": "Database engine: postgresql, mysql or sqlite (default)",
|
|
|
|
"value": "postgresql"
|
|
|
|
},
|
2015-04-29 17:56:59 +02:00
|
|
|
{
|
|
|
|
"name": "DATABASE_NAME",
|
2015-06-01 18:37:01 +02:00
|
|
|
"description": "Database name",
|
2015-04-29 17:56:59 +02:00
|
|
|
"value": "default"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_USER",
|
2015-06-01 18:37:01 +02:00
|
|
|
"description": "Database user name",
|
2015-05-22 13:31:14 +02:00
|
|
|
"value": "django"
|
2015-04-29 17:56:59 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_PASSWORD",
|
2015-06-01 18:37:01 +02:00
|
|
|
"description": "Database user password",
|
2015-04-29 17:56:59 +02:00
|
|
|
"generate": "expression",
|
|
|
|
"from": "[a-zA-Z0-9]{16}"
|
2015-05-22 13:31:14 +02:00
|
|
|
},
|
|
|
|
{
|
2015-06-01 18:37:01 +02:00
|
|
|
"name": "APP_CONFIG",
|
2015-06-04 16:47:06 +02:00
|
|
|
"description": "Relative path to Gunicorn configuration file (optional)"
|
2015-06-01 18:37:01 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DJANGO_SECRET_KEY",
|
2015-06-04 16:47:06 +02:00
|
|
|
"description": "Set this to a long random string",
|
2015-06-01 18:37:01 +02:00
|
|
|
"generate": "expression",
|
|
|
|
"from": "[\\w]{50}"
|
2015-04-29 17:56:59 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|