weblate/openshift3/persistent-sqlite.json

280 lines
9.3 KiB
JSON

{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "weblate-persistent-sqlite",
"annotations": {
"openshift.io/display-name": "Weblate (Persistent / SQLite)",
"description": "Creates a Weblate installation with SQLite database. Requires that a single persistent volume be available. Cannot be scaled.",
"tags": "quickstart,python,weblate",
"iconClass": "icon-python"
}
},
"parameters": [
{
"name": "APPLICATION_NAME",
"description": "The name of the Weblate instance.",
"value": "my-weblate-site",
"from": "[a-zA-Z0-9]",
"required": true
},
{
"name": "WEBLATE_REPOSITORY_URL",
"description": "The URL of the Weblate Git repository.",
"value": "https://github.com/GrahamDumpleton/weblate",
"required": true
},
{
"name": "WEBLATE_VOLUME_SIZE",
"description": "Size of the persistent volume for all data.",
"value": "1Gi",
"required": true
},
{
"name": "WEBLATE_MEMORY_LIMIT",
"description": "Amount of memory available to Weblate.",
"value": "256Mi",
"required": true
},
{
"name": "WEBLATE_ADMIN_USERNAME",
"description": "Name of initial admin user to create",
"from": "admin[0-9]{5}",
"generate": "expression"
},
{
"name": "WEBLATE_ADMIN_PASSWORD",
"description": "Password of the initial admin user.",
"from": "[a-zA-Z0-9]{12}",
"generate": "expression"
},
{
"name": "WEBLATE_ADMIN_EMAIL",
"description": "Email address of the initial admin user.",
"value": "noreply@example.com",
"required": true
},
{
"name": "PYTHON_VERSION",
"description": "The version of the Python builder.",
"value": "3.5",
"required": true
}
],
"objects": [
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "${APPLICATION_NAME}-img",
"labels": {
"app": "${APPLICATION_NAME}"
}
}
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}"
}
},
"spec": {
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange"
}
],
"source": {
"type": "Git",
"git": {
"uri": "${WEBLATE_REPOSITORY_URL}"
}
},
"strategy": {
"type": "Source",
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"namespace": "openshift",
"name": "python:${PYTHON_VERSION}"
}
}
},
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "${APPLICATION_NAME}-img:latest"
}
}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}"
}
},
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"weblate"
],
"from": {
"kind": "ImageStreamTag",
"name": "${APPLICATION_NAME}-img:latest"
}
}
}
],
"replicas": 1,
"selector": {
"app": "${APPLICATION_NAME}",
"deploymentconfig": "${APPLICATION_NAME}"
},
"template": {
"metadata": {
"labels": {
"app": "${APPLICATION_NAME}",
"deploymentconfig": "${APPLICATION_NAME}"
}
},
"spec": {
"volumes": [
{
"name": "data",
"persistentVolumeClaim": {
"claimName": "${APPLICATION_NAME}-data"
}
}
],
"containers": [
{
"name": "weblate",
"image": "${APPLICATION_NAME}-img",
"ports": [
{
"containerPort": 8080,
"protocol": "TCP"
}
],
"resources": {
"limits": {
"memory": "${WEBLATE_MEMORY_LIMIT}"
}
},
"env": [
{
"name": "DJANGO_ADMIN_USERNAME",
"value": "${WEBLATE_ADMIN_USERNAME}"
},
{
"name": "DJANGO_ADMIN_PASSWORD",
"value": "${WEBLATE_ADMIN_PASSWORD}"
},
{
"name": "DJANGO_ADMIN_EMAIL",
"value": "${WEBLATE_ADMIN_EMAIL}"
}
],
"volumeMounts": [
{
"name": "data",
"mountPath": "/opt/app-root/data"
}
]
}
]
}
}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}"
}
},
"spec": {
"ports": [
{
"name": "8080-tcp",
"protocol": "TCP",
"port": 8080,
"targetPort": 8080
}
],
"selector": {
"app": "${APPLICATION_NAME}",
"deploymentconfig": "${APPLICATION_NAME}"
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}"
}
},
"spec": {
"host": "",
"to": {
"kind": "Service",
"name": "${APPLICATION_NAME}",
"weight": 100
},
"port": {
"targetPort": 8080
},
"tls": {
"termination": "edge",
"insecureEdgeTerminationPolicy": "Allow"
}
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "${APPLICATION_NAME}-data",
"labels": {
"app": "${APPLICATION_NAME}"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "${WEBLATE_VOLUME_SIZE}"
}
}
}
}
]
}