summaryrefslogtreecommitdiffstats
path: root/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json')
-rw-r--r--roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json124
1 files changed, 97 insertions, 27 deletions
diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json
index c4c55ddd8..063591a8f 100644
--- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json
+++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json
@@ -5,7 +5,7 @@
"name": "django-psql-example",
"annotations": {
"description": "An example Django application with a PostgreSQL database",
- "tags": "instant-app,python,django,postgresql",
+ "tags": "quickstart,python,django,postgresql",
"iconClass": "icon-python"
}
},
@@ -17,7 +17,7 @@
"kind": "Service",
"apiVersion": "v1",
"metadata": {
- "name": "django-psql-example",
+ "name": "${NAME}",
"annotations": {
"description": "Exposes and load balances the application pods"
}
@@ -31,7 +31,7 @@
}
],
"selector": {
- "name": "django-psql-example"
+ "name": "${NAME}"
}
}
},
@@ -39,13 +39,13 @@
"kind": "Route",
"apiVersion": "v1",
"metadata": {
- "name": "django-psql-example"
+ "name": "${NAME}"
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
- "name": "django-psql-example"
+ "name": "${NAME}"
}
}
},
@@ -53,7 +53,7 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
- "name": "django-psql-example",
+ "name": "${NAME}",
"annotations": {
"description": "Keeps track of changes in the application image"
}
@@ -63,7 +63,7 @@
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
- "name": "django-psql-example",
+ "name": "${NAME}",
"annotations": {
"description": "Defines how to build the application"
}
@@ -90,7 +90,7 @@
"output": {
"to": {
"kind": "ImageStreamTag",
- "name": "django-psql-example:latest"
+ "name": "${NAME}:latest"
}
},
"triggers": [
@@ -106,14 +106,17 @@
"secret": "${GITHUB_WEBHOOK_SECRET}"
}
}
- ]
+ ],
+ "postCommit": {
+ "script": "./manage.py test"
+ }
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
- "name": "django-psql-example",
+ "name": "${NAME}",
"annotations": {
"description": "Defines how to deploy the application server"
}
@@ -132,7 +135,7 @@
],
"from": {
"kind": "ImageStreamTag",
- "name": "django-psql-example:latest"
+ "name": "${NAME}:latest"
}
}
},
@@ -142,13 +145,13 @@
],
"replicas": 1,
"selector": {
- "name": "django-psql-example"
+ "name": "${NAME}"
},
"template": {
"metadata": {
- "name": "django-psql-example",
+ "name": "${NAME}",
"labels": {
- "name": "django-psql-example"
+ "name": "${NAME}"
}
},
"spec": {
@@ -161,6 +164,22 @@
"containerPort": 8080
}
],
+ "readinessProbe": {
+ "timeoutSeconds": 3,
+ "initialDelaySeconds": 3,
+ "httpGet": {
+ "path": "/health",
+ "port": 8080
+ }
+ },
+ "livenessProbe": {
+ "timeoutSeconds": 3,
+ "initialDelaySeconds": 30,
+ "httpGet": {
+ "path": "/health",
+ "port": 8080
+ }
+ },
"env": [
{
"name": "DATABASE_SERVICE_NAME",
@@ -190,7 +209,12 @@
"name": "DJANGO_SECRET_KEY",
"value": "${DJANGO_SECRET_KEY}"
}
- ]
+ ],
+ "resources": {
+ "limits": {
+ "memory": "${MEMORY_LIMIT}"
+ }
+ }
}
]
}
@@ -285,7 +309,26 @@
"name": "POSTGRESQL_DATABASE",
"value": "${DATABASE_NAME}"
}
- ]
+ ],
+ "readinessProbe": {
+ "timeoutSeconds": 1,
+ "initialDelaySeconds": 5,
+ "exec": {
+ "command": [ "/bin/sh", "-i", "-c", "psql -h 127.0.0.1 -U ${POSTGRESQL_USER} -q -d ${POSTGRESQL_DATABASE} -c 'SELECT 1'"]
+ }
+ },
+ "livenessProbe": {
+ "timeoutSeconds": 1,
+ "initialDelaySeconds": 30,
+ "tcpSocket": {
+ "port": 5432
+ }
+ },
+ "resources": {
+ "limits": {
+ "memory": "${MEMORY_POSTGRESQL_LIMIT}"
+ }
+ }
}
]
}
@@ -295,62 +338,89 @@
],
"parameters": [
{
+ "name": "NAME",
+ "displayName": "Name",
+ "description": "The name assigned to all of the frontend objects defined in this template.",
+ "required": true,
+ "value": "django-psql-example"
+ },
+ {
+ "name": "MEMORY_LIMIT",
+ "displayName": "Memory Limit",
+ "description": "Maximum amount of memory the Django container can use.",
+ "value": "512Mi"
+ },
+ {
+ "name": "MEMORY_POSTGRESQL_LIMIT",
+ "displayName": "Memory Limit (PostgreSQL)",
+ "description": "Maximum amount of memory the PostgreSQL container can use.",
+ "value": "512Mi"
+ },
+ {
"name": "SOURCE_REPOSITORY_URL",
- "description": "The URL of the repository with your application source code",
+ "displayName": "Git Repository URL",
+ "description": "The URL of the repository with your application source code.",
"value": "https://github.com/openshift/django-ex.git"
},
{
"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"
+ "displayName": "Git Reference",
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
},
{
"name": "CONTEXT_DIR",
- "description": "Set this to the relative path to your project if it is not in the root of your repository"
+ "displayName": "Context Directory",
+ "description": "Set this to the relative path to your project if it is not in the root of your repository."
},
{
"name": "APPLICATION_DOMAIN",
+ "displayName": "Application Hostname",
"description": "The exposed hostname that will route to the Django service, if left blank a value will be defaulted.",
"value": ""
},
{
"name": "GITHUB_WEBHOOK_SECRET",
- "description": "A secret string used to configure the GitHub webhook",
+ "displayName": "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",
- "description": "Database service name",
+ "displayName": "Database Service Name",
"value": "postgresql"
},
{
"name": "DATABASE_ENGINE",
- "description": "Database engine: postgresql, mysql or sqlite (default)",
+ "displayName": "Database Engine",
+ "description": "Database engine: postgresql, mysql or sqlite (default).",
"value": "postgresql"
},
{
"name": "DATABASE_NAME",
- "description": "Database name",
+ "displayName": "Database Name",
"value": "default"
},
{
"name": "DATABASE_USER",
- "description": "Database user name",
+ "displayName": "Database Username",
"value": "django"
},
{
"name": "DATABASE_PASSWORD",
- "description": "Database user password",
+ "displayName": "Database User Password",
"generate": "expression",
"from": "[a-zA-Z0-9]{16}"
},
{
"name": "APP_CONFIG",
- "description": "Relative path to Gunicorn configuration file (optional)"
+ "displayName": "Application Configuration File Path",
+ "description": "Relative path to Gunicorn configuration file (optional)."
},
{
"name": "DJANGO_SECRET_KEY",
- "description": "Set this to a long random string",
+ "displayName": "Djange Secret Key",
+ "description": "Set this to a long random string.",
"generate": "expression",
"from": "[\\w]{50}"
}