summaryrefslogtreecommitdiffstats
path: root/roles/openshift_examples/files/examples/db-templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_examples/files/examples/db-templates')
-rw-r--r--roles/openshift_examples/files/examples/db-templates/mongodb-ephemeral-template.json184
-rw-r--r--roles/openshift_examples/files/examples/db-templates/mongodb-persistent-template.json207
-rw-r--r--roles/openshift_examples/files/examples/db-templates/mysql-ephemeral-template.json173
-rw-r--r--roles/openshift_examples/files/examples/db-templates/mysql-persistent-template.json196
-rw-r--r--roles/openshift_examples/files/examples/db-templates/postgresql-ephemeral-template.json173
-rw-r--r--roles/openshift_examples/files/examples/db-templates/postgresql-persistent-template.json196
6 files changed, 0 insertions, 1129 deletions
diff --git a/roles/openshift_examples/files/examples/db-templates/mongodb-ephemeral-template.json b/roles/openshift_examples/files/examples/db-templates/mongodb-ephemeral-template.json
deleted file mode 100644
index 6b90fa54e..000000000
--- a/roles/openshift_examples/files/examples/db-templates/mongodb-ephemeral-template.json
+++ /dev/null
@@ -1,184 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1",
- "metadata": {
- "name": "mongodb-ephemeral",
- "creationTimestamp": null,
- "annotations": {
- "description": "MongoDB database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
- "iconClass": "icon-mongodb",
- "tags": "database,mongodb"
- }
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "ports": [
- {
- "name": "mongo",
- "protocol": "TCP",
- "port": 27017,
- "targetPort": 27017,
- "nodePort": 0
- }
- ],
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "portalIP": "",
- "type": "ClusterIP",
- "sessionAffinity": "None"
- },
- "status": {
- "loadBalancer": {}
- }
- },
- {
- "kind": "DeploymentConfig",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "strategy": {
- "type": "Recreate",
- "resources": {}
- },
- "triggers": [
- {
- "type": "ImageChange",
- "imageChangeParams": {
- "automatic": true,
- "containerNames": [
- "mongodb"
- ],
- "from": {
- "kind": "ImageStreamTag",
- "name": "mongodb:latest",
- "namespace": "openshift"
- },
- "lastTriggeredImage": ""
- }
- },
- {
- "type": "ConfigChange"
- }
- ],
- "replicas": 1,
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "name": "${DATABASE_SERVICE_NAME}"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "mongodb",
- "image": "mongodb",
- "ports": [
- {
- "containerPort": 27017,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "MONGODB_USER",
- "value": "${MONGODB_USER}"
- },
- {
- "name": "MONGODB_PASSWORD",
- "value": "${MONGODB_PASSWORD}"
- },
- {
- "name": "MONGODB_DATABASE",
- "value": "${MONGODB_DATABASE}"
- },
- {
- "name": "MONGODB_ADMIN_PASSWORD",
- "value": "${MONGODB_ADMIN_PASSWORD}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "mountPath": "/var/lib/mongodb/data"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {},
- "securityContext": {
- "capabilities": {},
- "privileged": false
- }
- }
- ],
- "volumes": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "emptyDir": {
- "medium": ""
- }
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {}
- }
- ],
- "parameters": [
- {
- "name": "DATABASE_SERVICE_NAME",
- "description": "Database service name",
- "value": "mongodb",
- "required": true
- },
- {
- "name": "MONGODB_USER",
- "description": "Username for MongoDB user that will be used for accessing the database",
- "generate": "expression",
- "from": "user[A-Z0-9]{3}",
- "required": true
- },
- {
- "name": "MONGODB_PASSWORD",
- "description": "Password for the MongoDB user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "MONGODB_DATABASE",
- "description": "Database name",
- "value": "sampledb",
- "required": true
- },
- {
- "name": "MONGODB_ADMIN_PASSWORD",
- "description": "Password for the database admin user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- }
- ],
- "labels": {
- "template": "mongodb-ephemeral-template"
- }
-}
diff --git a/roles/openshift_examples/files/examples/db-templates/mongodb-persistent-template.json b/roles/openshift_examples/files/examples/db-templates/mongodb-persistent-template.json
deleted file mode 100644
index 97b315600..000000000
--- a/roles/openshift_examples/files/examples/db-templates/mongodb-persistent-template.json
+++ /dev/null
@@ -1,207 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1",
- "metadata": {
- "name": "mongodb-persistent",
- "creationTimestamp": null,
- "annotations": {
- "description": "MongoDB database service, with persistent storage. Scaling to more than one replica is not supported",
- "iconClass": "icon-mongodb",
- "tags": "database,mongodb"
- }
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "ports": [
- {
- "name": "mongo",
- "protocol": "TCP",
- "port": 27017,
- "targetPort": 27017,
- "nodePort": 0
- }
- ],
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "portalIP": "",
- "type": "ClusterIP",
- "sessionAffinity": "None"
- },
- "status": {
- "loadBalancer": {}
- }
- },
- {
- "kind": "PersistentVolumeClaim",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "spec": {
- "accessModes": [
- "ReadWriteOnce"
- ],
- "resources": {
- "requests": {
- "storage": "${VOLUME_CAPACITY}"
- }
- }
- }
- },
- {
- "kind": "DeploymentConfig",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "strategy": {
- "type": "Recreate",
- "resources": {}
- },
- "triggers": [
- {
- "type": "ImageChange",
- "imageChangeParams": {
- "automatic": true,
- "containerNames": [
- "mongodb"
- ],
- "from": {
- "kind": "ImageStreamTag",
- "name": "mongodb:latest",
- "namespace": "openshift"
- },
- "lastTriggeredImage": ""
- }
- },
- {
- "type": "ConfigChange"
- }
- ],
- "replicas": 1,
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "name": "${DATABASE_SERVICE_NAME}"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "mongodb",
- "image": "mongodb",
- "ports": [
- {
- "containerPort": 27017,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "MONGODB_USER",
- "value": "${MONGODB_USER}"
- },
- {
- "name": "MONGODB_PASSWORD",
- "value": "${MONGODB_PASSWORD}"
- },
- {
- "name": "MONGODB_DATABASE",
- "value": "${MONGODB_DATABASE}"
- },
- {
- "name": "MONGODB_ADMIN_PASSWORD",
- "value": "${MONGODB_ADMIN_PASSWORD}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "mountPath": "/var/lib/mongodb/data"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {},
- "securityContext": {
- "capabilities": {},
- "privileged": false
- }
- }
- ],
- "volumes": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "persistentVolumeClaim": {
- "claimName": "${DATABASE_SERVICE_NAME}"
- }
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {}
- }
- ],
- "parameters": [
- {
- "name": "DATABASE_SERVICE_NAME",
- "description": "Database service name",
- "value": "mongodb",
- "required": true
- },
- {
- "name": "MONGODB_USER",
- "description": "Username for MongoDB user that will be used for accessing the database",
- "generate": "expression",
- "from": "user[A-Z0-9]{3}",
- "required": true
- },
- {
- "name": "MONGODB_PASSWORD",
- "description": "Password for the MongoDB user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "MONGODB_DATABASE",
- "description": "Database name",
- "value": "sampledb",
- "required": true
- },
- {
- "name": "MONGODB_ADMIN_PASSWORD",
- "description": "Password for the database admin user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "VOLUME_CAPACITY",
- "description": "Volume space available for data, e.g. 512Mi, 2Gi",
- "value": "512Mi",
- "required": true
- }
- ],
- "labels": {
- "template": "mongodb-persistent-template"
- }
-}
diff --git a/roles/openshift_examples/files/examples/db-templates/mysql-ephemeral-template.json b/roles/openshift_examples/files/examples/db-templates/mysql-ephemeral-template.json
deleted file mode 100644
index b384a5992..000000000
--- a/roles/openshift_examples/files/examples/db-templates/mysql-ephemeral-template.json
+++ /dev/null
@@ -1,173 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1",
- "metadata": {
- "name": "mysql-ephemeral",
- "creationTimestamp": null,
- "annotations": {
- "description": "MySQL database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
- "iconClass": "icon-mysql-database",
- "tags": "database,mysql"
- }
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "ports": [
- {
- "name": "mysql",
- "protocol": "TCP",
- "port": 3306,
- "targetPort": 3306,
- "nodePort": 0
- }
- ],
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "portalIP": "",
- "type": "ClusterIP",
- "sessionAffinity": "None"
- },
- "status": {
- "loadBalancer": {}
- }
- },
- {
- "kind": "DeploymentConfig",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "strategy": {
- "type": "Recreate",
- "resources": {}
- },
- "triggers": [
- {
- "type": "ImageChange",
- "imageChangeParams": {
- "automatic": true,
- "containerNames": [
- "mysql"
- ],
- "from": {
- "kind": "ImageStreamTag",
- "name": "mysql:latest",
- "namespace": "openshift"
- },
- "lastTriggeredImage": ""
- }
- },
- {
- "type": "ConfigChange"
- }
- ],
- "replicas": 1,
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "name": "${DATABASE_SERVICE_NAME}"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "mysql",
- "image": "mysql",
- "ports": [
- {
- "containerPort": 3306,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "MYSQL_USER",
- "value": "${MYSQL_USER}"
- },
- {
- "name": "MYSQL_PASSWORD",
- "value": "${MYSQL_PASSWORD}"
- },
- {
- "name": "MYSQL_DATABASE",
- "value": "${MYSQL_DATABASE}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "mountPath": "/var/lib/mysql/data"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {},
- "securityContext": {
- "capabilities": {},
- "privileged": false
- }
- }
- ],
- "volumes": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "emptyDir": {
- "medium": ""
- }
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {}
- }
- ],
- "parameters": [
- {
- "name": "DATABASE_SERVICE_NAME",
- "description": "Database service name",
- "value": "mysql",
- "required": true
- },
- {
- "name": "MYSQL_USER",
- "description": "Username for MySQL user that will be used for accessing the database",
- "generate": "expression",
- "from": "user[A-Z0-9]{3}",
- "required": true
- },
- {
- "name": "MYSQL_PASSWORD",
- "description": "Password for the MySQL user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "MYSQL_DATABASE",
- "description": "Database name",
- "value": "sampledb",
- "required": true
- }
- ],
- "labels": {
- "template": "mysql-ephemeral-template"
- }
-}
diff --git a/roles/openshift_examples/files/examples/db-templates/mysql-persistent-template.json b/roles/openshift_examples/files/examples/db-templates/mysql-persistent-template.json
deleted file mode 100644
index 6e19f48f5..000000000
--- a/roles/openshift_examples/files/examples/db-templates/mysql-persistent-template.json
+++ /dev/null
@@ -1,196 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1",
- "metadata": {
- "name": "mysql-persistent",
- "creationTimestamp": null,
- "annotations": {
- "description": "MySQL database service, with persistent storage. Scaling to more than one replica is not supported",
- "iconClass": "icon-mysql-database",
- "tags": "database,mysql"
- }
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "ports": [
- {
- "name": "mysql",
- "protocol": "TCP",
- "port": 3306,
- "targetPort": 3306,
- "nodePort": 0
- }
- ],
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "portalIP": "",
- "type": "ClusterIP",
- "sessionAffinity": "None"
- },
- "status": {
- "loadBalancer": {}
- }
- },
- {
- "kind": "PersistentVolumeClaim",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "spec": {
- "accessModes": [
- "ReadWriteOnce"
- ],
- "resources": {
- "requests": {
- "storage": "${VOLUME_CAPACITY}"
- }
- }
- }
- },
- {
- "kind": "DeploymentConfig",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "strategy": {
- "type": "Recreate",
- "resources": {}
- },
- "triggers": [
- {
- "type": "ImageChange",
- "imageChangeParams": {
- "automatic": true,
- "containerNames": [
- "mysql"
- ],
- "from": {
- "kind": "ImageStreamTag",
- "name": "mysql:latest",
- "namespace": "openshift"
- },
- "lastTriggeredImage": ""
- }
- },
- {
- "type": "ConfigChange"
- }
- ],
- "replicas": 1,
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "name": "${DATABASE_SERVICE_NAME}"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "mysql",
- "image": "mysql",
- "ports": [
- {
- "containerPort": 3306,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "MYSQL_USER",
- "value": "${MYSQL_USER}"
- },
- {
- "name": "MYSQL_PASSWORD",
- "value": "${MYSQL_PASSWORD}"
- },
- {
- "name": "MYSQL_DATABASE",
- "value": "${MYSQL_DATABASE}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "mountPath": "/var/lib/mysql/data"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {},
- "securityContext": {
- "capabilities": {},
- "privileged": false
- }
- }
- ],
- "volumes": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "persistentVolumeClaim": {
- "claimName": "${DATABASE_SERVICE_NAME}"
- }
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {}
- }
- ],
- "parameters": [
- {
- "name": "DATABASE_SERVICE_NAME",
- "description": "Database service name",
- "value": "mysql",
- "required": true
- },
- {
- "name": "MYSQL_USER",
- "description": "Username for MySQL user that will be used for accessing the database",
- "generate": "expression",
- "from": "user[A-Z0-9]{3}",
- "required": true
- },
- {
- "name": "MYSQL_PASSWORD",
- "description": "Password for the MySQL user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "MYSQL_DATABASE",
- "description": "Database name",
- "value": "sampledb",
- "required": true
- },
- {
- "name": "VOLUME_CAPACITY",
- "description": "Volume space available for data, e.g. 512Mi, 2Gi",
- "value": "512Mi",
- "required": true
- }
- ],
- "labels": {
- "template": "mysql-persistent-template"
- }
-}
diff --git a/roles/openshift_examples/files/examples/db-templates/postgresql-ephemeral-template.json b/roles/openshift_examples/files/examples/db-templates/postgresql-ephemeral-template.json
deleted file mode 100644
index 60d6b8519..000000000
--- a/roles/openshift_examples/files/examples/db-templates/postgresql-ephemeral-template.json
+++ /dev/null
@@ -1,173 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1",
- "metadata": {
- "name": "postgresql-ephemeral",
- "creationTimestamp": null,
- "annotations": {
- "description": "PostgreSQL database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
- "iconClass": "icon-postgresql",
- "tags": "database,postgresql"
- }
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "ports": [
- {
- "name": "postgresql",
- "protocol": "TCP",
- "port": 5432,
- "targetPort": 5432,
- "nodePort": 0
- }
- ],
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "portalIP": "",
- "type": "ClusterIP",
- "sessionAffinity": "None"
- },
- "status": {
- "loadBalancer": {}
- }
- },
- {
- "kind": "DeploymentConfig",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "strategy": {
- "type": "Recreate",
- "resources": {}
- },
- "triggers": [
- {
- "type": "ImageChange",
- "imageChangeParams": {
- "automatic": true,
- "containerNames": [
- "postgresql"
- ],
- "from": {
- "kind": "ImageStreamTag",
- "name": "postgresql:latest",
- "namespace": "openshift"
- },
- "lastTriggeredImage": ""
- }
- },
- {
- "type": "ConfigChange"
- }
- ],
- "replicas": 1,
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "name": "${DATABASE_SERVICE_NAME}"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "postgresql",
- "image": "postgresql",
- "ports": [
- {
- "containerPort": 5432,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "POSTGRESQL_USER",
- "value": "${POSTGRESQL_USER}"
- },
- {
- "name": "POSTGRESQL_PASSWORD",
- "value": "${POSTGRESQL_PASSWORD}"
- },
- {
- "name": "POSTGRESQL_DATABASE",
- "value": "${POSTGRESQL_DATABASE}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "mountPath": "/var/lib/pgsql/data"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {},
- "securityContext": {
- "capabilities": {},
- "privileged": false
- }
- }
- ],
- "volumes": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "emptyDir": {
- "medium": ""
- }
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {}
- }
- ],
- "parameters": [
- {
- "name": "DATABASE_SERVICE_NAME",
- "description": "Database service name",
- "value": "postgresql",
- "required": true
- },
- {
- "name": "POSTGRESQL_USER",
- "description": "Username for PostgreSQL user that will be used for accessing the database",
- "generate": "expression",
- "from": "user[A-Z0-9]{3}",
- "required": true
- },
- {
- "name": "POSTGRESQL_PASSWORD",
- "description": "Password for the PostgreSQL user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "POSTGRESQL_DATABASE",
- "description": "Database name",
- "value": "sampledb",
- "required": true
- }
- ],
- "labels": {
- "template": "postgresql-ephemeral-template"
- }
-}
diff --git a/roles/openshift_examples/files/examples/db-templates/postgresql-persistent-template.json b/roles/openshift_examples/files/examples/db-templates/postgresql-persistent-template.json
deleted file mode 100644
index 91cd7453e..000000000
--- a/roles/openshift_examples/files/examples/db-templates/postgresql-persistent-template.json
+++ /dev/null
@@ -1,196 +0,0 @@
-{
- "kind": "Template",
- "apiVersion": "v1",
- "metadata": {
- "name": "postgresql-persistent",
- "creationTimestamp": null,
- "annotations": {
- "description": "PostgreSQL database service, with persistent storage. Scaling to more than one replica is not supported",
- "iconClass": "icon-postgresql",
- "tags": "database,postgresql"
- }
- },
- "objects": [
- {
- "kind": "Service",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "ports": [
- {
- "name": "postgresql",
- "protocol": "TCP",
- "port": 5432,
- "targetPort": 5432,
- "nodePort": 0
- }
- ],
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "portalIP": "",
- "type": "ClusterIP",
- "sessionAffinity": "None"
- },
- "status": {
- "loadBalancer": {}
- }
- },
- {
- "kind": "PersistentVolumeClaim",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "spec": {
- "accessModes": [
- "ReadWriteOnce"
- ],
- "resources": {
- "requests": {
- "storage": "${VOLUME_CAPACITY}"
- }
- }
- }
- },
- {
- "kind": "DeploymentConfig",
- "apiVersion": "v1",
- "metadata": {
- "name": "${DATABASE_SERVICE_NAME}",
- "creationTimestamp": null
- },
- "spec": {
- "strategy": {
- "type": "Recreate",
- "resources": {}
- },
- "triggers": [
- {
- "type": "ImageChange",
- "imageChangeParams": {
- "automatic": true,
- "containerNames": [
- "postgresql"
- ],
- "from": {
- "kind": "ImageStreamTag",
- "name": "postgresql:latest",
- "namespace": "openshift"
- },
- "lastTriggeredImage": ""
- }
- },
- {
- "type": "ConfigChange"
- }
- ],
- "replicas": 1,
- "selector": {
- "name": "${DATABASE_SERVICE_NAME}"
- },
- "template": {
- "metadata": {
- "creationTimestamp": null,
- "labels": {
- "name": "${DATABASE_SERVICE_NAME}"
- }
- },
- "spec": {
- "containers": [
- {
- "name": "postgresql",
- "image": "postgresql",
- "ports": [
- {
- "containerPort": 5432,
- "protocol": "TCP"
- }
- ],
- "env": [
- {
- "name": "POSTGRESQL_USER",
- "value": "${POSTGRESQL_USER}"
- },
- {
- "name": "POSTGRESQL_PASSWORD",
- "value": "${POSTGRESQL_PASSWORD}"
- },
- {
- "name": "POSTGRESQL_DATABASE",
- "value": "${POSTGRESQL_DATABASE}"
- }
- ],
- "resources": {},
- "volumeMounts": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "mountPath": "/var/lib/pgsql/data"
- }
- ],
- "terminationMessagePath": "/dev/termination-log",
- "imagePullPolicy": "IfNotPresent",
- "capabilities": {},
- "securityContext": {
- "capabilities": {},
- "privileged": false
- }
- }
- ],
- "volumes": [
- {
- "name": "${DATABASE_SERVICE_NAME}-data",
- "persistentVolumeClaim": {
- "claimName": "${DATABASE_SERVICE_NAME}"
- }
- }
- ],
- "restartPolicy": "Always",
- "dnsPolicy": "ClusterFirst"
- }
- }
- },
- "status": {}
- }
- ],
- "parameters": [
- {
- "name": "DATABASE_SERVICE_NAME",
- "description": "Database service name",
- "value": "postgresql",
- "required": true
- },
- {
- "name": "POSTGRESQL_USER",
- "description": "Username for PostgreSQL user that will be used for accessing the database",
- "generate": "expression",
- "from": "user[A-Z0-9]{3}",
- "required": true
- },
- {
- "name": "POSTGRESQL_PASSWORD",
- "description": "Password for the PostgreSQL user",
- "generate": "expression",
- "from": "[a-zA-Z0-9]{16}",
- "required": true
- },
- {
- "name": "POSTGRESQL_DATABASE",
- "description": "Database name",
- "value": "sampledb",
- "required": true
- },
- {
- "name": "VOLUME_CAPACITY",
- "description": "Volume space available for data, e.g. 512Mi, 2Gi",
- "value": "512Mi",
- "required": true
- }
- ],
- "labels": {
- "template": "postgresql-persistent-template"
- }
-}