Update template to v1
This commit is contained in:
parent
a3d47d74cc
commit
5548c3ad52
1 changed files with 211 additions and 193 deletions
|
@ -1,133 +1,154 @@
|
|||
{
|
||||
"kind": "Template",
|
||||
"apiVersion": "v1beta1",
|
||||
"labels": {
|
||||
"template": "django-app-template-sti"
|
||||
},
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "django-app",
|
||||
"name": "Django Quickstart",
|
||||
"annotations": {
|
||||
"description": "This is a Django application template for OpenShift",
|
||||
"tags": "python,django,postgres",
|
||||
"description": "This is a Django application template that uses PostgreSQL for data storage.",
|
||||
"tags": "instant-app,python,django,postgresql",
|
||||
"iconClass" : "icon-python"
|
||||
}
|
||||
},
|
||||
"items": [
|
||||
"labels": {
|
||||
"template": "django-quickstart-sti"
|
||||
},
|
||||
"objects": [
|
||||
{
|
||||
"kind": "Service",
|
||||
"id": "web",
|
||||
"apiVersion": "v1beta1",
|
||||
"port": 80,
|
||||
"containerPort": 8080,
|
||||
"selector": {
|
||||
"name": "web"
|
||||
},
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "${FRONTEND_SERVICE_NAME}",
|
||||
"annotations": {
|
||||
"description": "Exposes and load balances the Django app instances."
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "web",
|
||||
"port": 5432,
|
||||
"targetPort": 8080
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"name": "${FRONTEND_SERVICE_NAME}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"id": "database",
|
||||
"apiVersion": "v1beta1",
|
||||
"port": 5432,
|
||||
"containerPort": 5432,
|
||||
"selector": {
|
||||
"name": "database"
|
||||
},
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "${DATABASE_SERVICE_NAME}",
|
||||
"annotations": {
|
||||
"description": "Exposes the PostgreSQL database server."
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "postgresql",
|
||||
"port": 5432,
|
||||
"targetPort": 5432
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"name": "${DATABASE_SERVICE_NAME}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "BuildConfig",
|
||||
"apiVersion": "v1beta1",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "django-app",
|
||||
"name": "django-quickstart",
|
||||
"labels": {
|
||||
"name": "django-app"
|
||||
"name": "django-quickstart"
|
||||
},
|
||||
"annotations": {
|
||||
"description": "Defines how to build the Django app."
|
||||
}
|
||||
},
|
||||
"parameters": {
|
||||
"strategy": {
|
||||
"type": "STI",
|
||||
"stiStrategy": {
|
||||
"image": "openshift/python-33-centos7"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"source": {
|
||||
"type": "Git",
|
||||
"git": {
|
||||
"uri": "${PROJECT_REPO}"
|
||||
"uri": "${GIT_REPOSITORY}"
|
||||
},
|
||||
"contextDir": "${CONTEXT_DIR}"
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Source",
|
||||
"SourceStrategy": {
|
||||
"from": {
|
||||
"name": "python-33-centos7"
|
||||
}
|
||||
}
|
||||
},
|
||||
"output": {
|
||||
"to": {
|
||||
"name": "django-app"
|
||||
}
|
||||
"name": "django-quickstart"
|
||||
}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "imageChange",
|
||||
"imageChange": {
|
||||
"from": {
|
||||
"name": "python-33-centos7"
|
||||
},
|
||||
"image": "openshift/python-33-centos7",
|
||||
"tag": "latest"
|
||||
}
|
||||
"type": "ImageChange"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"type": "GitHub",
|
||||
"github": {
|
||||
"secret": "secret123"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "generic",
|
||||
"type": "Generic",
|
||||
"generic": {
|
||||
"secret": "secret123"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1beta1",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "web",
|
||||
"name": "${FRONTEND_SERVICE_NAME}",
|
||||
"labels": {
|
||||
"name": "web"
|
||||
"name": "${FRONTEND_SERVICE_NAME}"
|
||||
},
|
||||
"annotations": {
|
||||
"description": "Defines how to deploy the Django app."
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"type": "Rolling"
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"django-quickstart"
|
||||
],
|
||||
"from": {
|
||||
"name": "django-quickstart"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"replicas": 2,
|
||||
"selector": {
|
||||
"name": "${FRONTEND_SERVICE_NAME}"
|
||||
},
|
||||
"template": {
|
||||
"controllerTemplate": {
|
||||
"replicaSelector": {
|
||||
"name": "web"
|
||||
},
|
||||
"replicas": 1,
|
||||
"podTemplate": {
|
||||
"labels": {
|
||||
"name": "web"
|
||||
},
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "django",
|
||||
"image": "django-app",
|
||||
"name": "django-quickstart",
|
||||
"image": "django-quickstart",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 8080
|
||||
|
@ -138,6 +159,14 @@
|
|||
"name": "APP_MODULE",
|
||||
"value": "${APP_MODULE}"
|
||||
},
|
||||
{
|
||||
"name": "DJANGO_ADMIN_USER",
|
||||
"value": "${DJANGO_SECRET_KEY}"
|
||||
},
|
||||
{
|
||||
"name": "DJANGO_ADMIN_PASSWORD",
|
||||
"value": "${DJANGO_SECRET_KEY}"
|
||||
},
|
||||
{
|
||||
"name": "DJANGO_SECRET_KEY",
|
||||
"value": "${DJANGO_SECRET_KEY}"
|
||||
|
@ -153,62 +182,36 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate",
|
||||
"recreateParams": {
|
||||
"pre": {
|
||||
"failurePolicy": "Abort",
|
||||
"execNewPod": {
|
||||
"containerName": "django",
|
||||
"command": [
|
||||
"./scripts/pre_deploy.sh"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ImageChange",
|
||||
"imageChangeParams": {
|
||||
"automatic": true,
|
||||
"containerNames": [
|
||||
"django"
|
||||
],
|
||||
"from": {
|
||||
"name": "django-app"
|
||||
},
|
||||
"tag": "latest"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1beta1",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "database",
|
||||
"name": "${DATABASE_SERVICE_NAME}",
|
||||
"labels": {
|
||||
"name": "${DATABASE_SERVICE_NAME}"
|
||||
},
|
||||
"annotations": {
|
||||
"description": "Defines how to deploy the database."
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"controllerTemplate": {
|
||||
"replicaSelector": {
|
||||
"name": "database"
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
}
|
||||
],
|
||||
"replicas": 1,
|
||||
"podTemplate": {
|
||||
"labels": {
|
||||
"name": "database"
|
||||
"selector": {
|
||||
"name": "${DATABASE_SERVICE_NAME}"
|
||||
},
|
||||
"desiredState": {
|
||||
"manifest": {
|
||||
"version": "v1beta1",
|
||||
"template": {
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "database",
|
||||
"name": "postgresql",
|
||||
"image": "openshift/postgresql-92-centos7",
|
||||
"ports": [
|
||||
{
|
||||
|
@ -235,33 +238,23 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"strategy": {
|
||||
"type": "Recreate"
|
||||
}
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
"type": "ConfigChange"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1beta1",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "django-app",
|
||||
"name": "django-quickstart",
|
||||
"annotations": {
|
||||
"description": "Augments the Docker registry, keeps track of image changes for the Django app."
|
||||
"description": "Keeps track of changes in the Django app image."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "ImageStream",
|
||||
"apiVersion": "v1beta1",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "python-33-centos7",
|
||||
"annotations": {
|
||||
"description": "Augments the Docker registry, keeps track of image changes for Python base image."
|
||||
"description": "Keeps track of changes in the Python base image."
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
|
@ -271,18 +264,33 @@
|
|||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "GIT_REPOSITORY",
|
||||
"description": "Change this to match your project's Git repository",
|
||||
"name": "PROJECT_REPO",
|
||||
"value": "git://github.com/rhcarvalho/openshift-django-quickstart.git"
|
||||
},
|
||||
{
|
||||
"description": "Django WSGI application",
|
||||
"name": "CONTEXT_DIR",
|
||||
"description": "Change this to the relative path to your project if it is not in the root of your repository",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "APP_MODULE",
|
||||
"description": "Python dotted path to your Django WSGI application",
|
||||
"value": "project.wsgi"
|
||||
},
|
||||
{
|
||||
"description": "Django secret key",
|
||||
"name": "DJANGO_ADMIN_USER",
|
||||
"description": "User name for Django Admin interface",
|
||||
"value": "admin"
|
||||
},
|
||||
{
|
||||
"name": "DJANGO_ADMIN_PASSWORD",
|
||||
"description": "Password for Django Admin interface",
|
||||
"value": "admin"
|
||||
},
|
||||
{
|
||||
"name": "DJANGO_SECRET_KEY",
|
||||
"description": "Django secret key",
|
||||
"generate": "expression",
|
||||
"from": "[\\w]{50}"
|
||||
},
|
||||
|
@ -294,13 +302,23 @@
|
|||
{
|
||||
"description": "Database user name",
|
||||
"name": "DATABASE_USER",
|
||||
"value": "admin"
|
||||
"value": "django"
|
||||
},
|
||||
{
|
||||
"description": "Database user password",
|
||||
"name": "DATABASE_PASSWORD",
|
||||
"generate": "expression",
|
||||
"from": "[a-zA-Z0-9]{16}"
|
||||
},
|
||||
{
|
||||
"description": "Frontend service name (Django)",
|
||||
"name": "FRONTEND_SERVICE_NAME",
|
||||
"value": "web"
|
||||
},
|
||||
{
|
||||
"description": "Database service name (PostgreSQL)",
|
||||
"name": "DATABASE_SERVICE_NAME",
|
||||
"value": "database"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue