From aab6d7dd1096b4379216ca7c0d8e6e57bb8ab7a9 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Wed, 2 Dec 2015 16:24:20 -0500 Subject: Update sync db-templates, image-streams, and quickstart-templates --- .../files/examples/v1.1/db-templates/README.md | 100 +++++++++++++++++++++ .../db-templates/mongodb-ephemeral-template.json | 2 +- .../db-templates/mysql-ephemeral-template.json | 2 +- .../postgresql-ephemeral-template.json | 2 +- .../v1.1/image-streams/image-streams-centos7.json | 14 +-- .../v1.1/image-streams/image-streams-rhel7.json | 14 +-- .../v1.1/quickstart-templates/cakephp-mysql.json | 26 ++++-- .../v1.1/quickstart-templates/cakephp.json | 5 +- .../v1.1/quickstart-templates/dancer-mysql.json | 26 ++++-- .../examples/v1.1/quickstart-templates/dancer.json | 5 +- .../quickstart-templates/django-postgresql.json | 26 ++++-- .../examples/v1.1/quickstart-templates/django.json | 5 +- .../jenkins-ephemeral-template.json | 22 +++-- .../jenkins-persistent-template.json | 22 +++-- .../v1.1/quickstart-templates/nodejs-mongodb.json | 24 +++-- .../examples/v1.1/quickstart-templates/nodejs.json | 3 + .../quickstart-templates/rails-postgresql.json | 28 ++++-- 17 files changed, 259 insertions(+), 67 deletions(-) create mode 100644 roles/openshift_examples/files/examples/v1.1/db-templates/README.md (limited to 'roles/openshift_examples/files') diff --git a/roles/openshift_examples/files/examples/v1.1/db-templates/README.md b/roles/openshift_examples/files/examples/v1.1/db-templates/README.md new file mode 100644 index 000000000..b39abf8b9 --- /dev/null +++ b/roles/openshift_examples/files/examples/v1.1/db-templates/README.md @@ -0,0 +1,100 @@ +OpenShift 3 Database Examples +============================= + +This directory contains example JSON templates to deploy databases in OpenShift. +They can be used to immediately instantiate a database and expose it as a +service in the current project, or to add a template that can be later used from +the Web Console or the CLI. + +The examples can also be tweaked to create new templates. + + +## Ephemeral x Persistent + +For each supported database, there are two template files. + +Files named `*-ephemeral-template.json` use +"[emptyDir](https://docs.openshift.org/latest/dev_guide/volumes.html)" volumes +for data storage, which means that data is lost after a pod restart. +This is tolerable for experimenting, but not suitable for production use. + +The other templates, named `*-persistent-template.json`, use [persistent volume +claims](https://docs.openshift.org/latest/architecture/additional_concepts/storage.html#persistent-volume-claims) +to request persistent storage provided by [persistent +volumes](https://docs.openshift.org/latest/architecture/additional_concepts/storage.html#persistent-volumes), +that must have been created upfront. + + +## Usage + +### Instantiating a new database service + +Use these instructions if you want to quickly deploy a new database service in +your current project. Instantiate a new database service with this command: + + $ oc new-app /path/to/template.json + +Replace `/path/to/template.json` with an appropriate path, that can be either a +local path or an URL. Example: + + $ oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/mongodb-ephemeral-template.json + --> Deploying template mongodb-ephemeral for "https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/mongodb-ephemeral-template.json" + With parameters: + DATABASE_SERVICE_NAME=mongodb + MONGODB_USER=userJNX # generated + MONGODB_PASSWORD=tnEDilMVrgjp5AI2 # generated + MONGODB_DATABASE=sampledb + MONGODB_ADMIN_PASSWORD=8bYEs8OlNYhVyMBs # generated + --> Creating resources ... + Service "mongodb" created + DeploymentConfig "mongodb" created + --> Success + Run 'oc status' to view your app. + +The parameters listed in the output above can be tweaked by specifying values in +the command line with the `-p` option: + + $ oc new-app examples/db-templates/mongodb-ephemeral-template.json -p DATABASE_SERVICE_NAME=mydb -p MONGODB_USER=default + --> Deploying template mongodb-ephemeral for "examples/db-templates/mongodb-ephemeral-template.json" + With parameters: + DATABASE_SERVICE_NAME=mydb + MONGODB_USER=default + MONGODB_PASSWORD=RPvMbWlQFOevSowQ # generated + MONGODB_DATABASE=sampledb + MONGODB_ADMIN_PASSWORD=K7tIjDxDHHYCvFrJ # generated + --> Creating resources ... + Service "mydb" created + DeploymentConfig "mydb" created + --> Success + Run 'oc status' to view your app. + +Note that the persistent template requires an existing persistent volume, +otherwise the deployment won't ever succeed. + + +### Adding a database as a template + +Use these instructions if, instead of instantiating a service right away, you +want to load the template into an OpenShift project so that it can be used +later. Create the template with this command: + + $ oc create -f /path/to/template.json + +Replace `/path/to/template.json` with an appropriate path, that can be either a +local path or an URL. Example: + + $ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/mongodb-ephemeral-template.json + template "mongodb-ephemeral" created + +The new template is now available to use in the Web Console or with `oc +new-app`. + + +## More information + +The usage of each supported database image is further documented in the links +below: + +- [MySQL](https://docs.openshift.org/latest/using_images/db_images/mysql.html) +- [PostgreSQL](https://docs.openshift.org/latest/using_images/db_images/postgresql.html) +- [MongoDB](https://docs.openshift.org/latest/using_images/db_images/mongodb.html) diff --git a/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json index 6b90fa54e..11767862d 100644 --- a/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json +++ b/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json @@ -55,7 +55,7 @@ { "type": "ImageChange", "imageChangeParams": { - "automatic": true, + "automatic": false, "containerNames": [ "mongodb" ], diff --git a/roles/openshift_examples/files/examples/v1.1/db-templates/mysql-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.1/db-templates/mysql-ephemeral-template.json index b384a5992..84911d2d6 100644 --- a/roles/openshift_examples/files/examples/v1.1/db-templates/mysql-ephemeral-template.json +++ b/roles/openshift_examples/files/examples/v1.1/db-templates/mysql-ephemeral-template.json @@ -55,7 +55,7 @@ { "type": "ImageChange", "imageChangeParams": { - "automatic": true, + "automatic": false, "containerNames": [ "mysql" ], diff --git a/roles/openshift_examples/files/examples/v1.1/db-templates/postgresql-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.1/db-templates/postgresql-ephemeral-template.json index 60d6b8519..9ee9364a9 100644 --- a/roles/openshift_examples/files/examples/v1.1/db-templates/postgresql-ephemeral-template.json +++ b/roles/openshift_examples/files/examples/v1.1/db-templates/postgresql-ephemeral-template.json @@ -55,7 +55,7 @@ { "type": "ImageChange", "imageChangeParams": { - "automatic": true, + "automatic": false, "containerNames": [ "postgresql" ], diff --git a/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-centos7.json b/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-centos7.json index 1a78b1279..51805d729 100644 --- a/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-centos7.json +++ b/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-centos7.json @@ -16,7 +16,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "2.0" + "Name": "2.2" } }, { @@ -99,7 +99,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "5.16" + "Name": "5.20" } }, { @@ -149,7 +149,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "5.5" + "Name": "5.6" } }, { @@ -198,7 +198,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "3.3" + "Name": "3.4" } }, { @@ -296,7 +296,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "5.5" + "Name": "5.6" } }, { @@ -329,7 +329,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "9.2" + "Name": "9.4" } }, { @@ -362,7 +362,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "2.4" + "Name": "2.6" } }, { diff --git a/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-rhel7.json b/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-rhel7.json index d2a8cfb1d..3092ee486 100644 --- a/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-rhel7.json +++ b/roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-rhel7.json @@ -16,7 +16,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "2.0" + "Name": "2.2" } }, { @@ -99,7 +99,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "5.16" + "Name": "5.20" } }, { @@ -149,7 +149,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "5.5" + "Name": "5.6" } }, { @@ -198,7 +198,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "3.3" + "Name": "3.4" } }, { @@ -262,7 +262,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "5.5" + "Name": "5.6" } }, { @@ -295,7 +295,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "9.2" + "Name": "9.4" } }, { @@ -328,7 +328,7 @@ "name": "latest", "from": { "Kind": "ImageStreamTag", - "Name": "2.4" + "Name": "2.6" } }, { diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp-mysql.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp-mysql.json index da5679444..52143da2d 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp-mysql.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp-mysql.json @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "php:5.5" + "name": "php:5.6" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { @@ -249,6 +252,20 @@ "type": "Recreate" }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "mysql" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "mysql:5.6" + } + } + }, { "type": "ConfigChange" } @@ -268,7 +285,7 @@ "containers": [ { "name": "mysql", - "image": "${MYSQL_IMAGE}", + "image": "mysql", "ports": [ { "containerPort": 3306 @@ -346,11 +363,6 @@ "generate": "expression", "from": "[a-zA-Z0-9]{16}" }, - { - "name": "MYSQL_IMAGE", - "description": "Image to use for mysql", - "value": "openshift/mysql-55-centos7" - }, { "name": "CAKEPHP_SECRET_TOKEN", "description": "Set this to a long random string", diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp.json index f426e1dd6..b77dc0c51 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp.json @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "php:5.5" + "name": "php:5.6" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer-mysql.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer-mysql.json index 55f655102..edc6a1f3f 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer-mysql.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer-mysql.json @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "perl:5.16" + "name": "perl:5.20" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { @@ -223,6 +226,20 @@ "type": "Recreate" }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "mysql" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "mysql:5.6" + } + } + }, { "type": "ConfigChange" } @@ -242,7 +259,7 @@ "containers": [ { "name": "mysql", - "image": "${MYSQL_IMAGE}", + "image": "mysql", "ports": [ { "containerPort": 3306 @@ -328,11 +345,6 @@ "description": "database name", "value": "sampledb" }, - { - "name": "MYSQL_IMAGE", - "description": "Image to use for mysql", - "value": "openshift/mysql-55-centos7" - }, { "name": "PERL_APACHE2_RELOAD", "description": "Set this to \"true\" to enable automatic reloading of modified Perl modules", diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer.json index 3ee19be83..409252d82 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer.json @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "perl:5.16" + "name": "perl:5.20" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { 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 749064e98..c4c55ddd8 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 @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "python:3.3" + "name": "python:3.4" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { @@ -230,6 +233,20 @@ "type": "Recreate" }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "postgresql" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "postgresql:9.4" + } + } + }, { "type": "ConfigChange" } @@ -249,7 +266,7 @@ "containers": [ { "name": "postgresql", - "image": "${POSTGRESQL_IMAGE}", + "image": "postgresql", "ports": [ { "containerPort": 5432 @@ -327,11 +344,6 @@ "generate": "expression", "from": "[a-zA-Z0-9]{16}" }, - { - "name": "POSTGRESQL_IMAGE", - "description": "Image to use for postgresql", - "value": "openshift/postgresql-92-centos7" - }, { "name": "APP_CONFIG", "description": "Relative path to Gunicorn configuration file (optional)" diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django.json index 143a942ab..75b6798b5 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/django.json @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "python:3.3" + "name": "python:3.4" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-ephemeral-template.json index 14bd032af..0b016373f 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-ephemeral-template.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-ephemeral-template.json @@ -7,7 +7,7 @@ "annotations": { "description": "Jenkins service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", "iconClass": "icon-jenkins", - "tags": "database,jenkins" + "tags": "instant-app,jenkins" } }, "objects": [ @@ -69,6 +69,21 @@ "resources": {} }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "jenkins" + ], + "from": { + "kind": "ImageStreamTag", + "name": "jenkins:latest", + "namespace": "openshift" + }, + "lastTriggeredImage": "" + } + }, { "type": "ConfigChange" } @@ -132,11 +147,6 @@ "description": "Jenkins service name", "value": "jenkins" }, - { - "name": "JENKINS_IMAGE", - "description": "Jenkins Docker image to use", - "value": "openshift/jenkins-1-centos7" - }, { "name": "JENKINS_PASSWORD", "description": "Password for the Jenkins user", diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-persistent-template.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-persistent-template.json index fa31de486..98f0cea95 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-persistent-template.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-persistent-template.json @@ -7,7 +7,7 @@ "annotations": { "description": "Jenkins service, with persistent storage.", "iconClass": "icon-jenkins", - "tags": "database,jenkins" + "tags": "instant-app,jenkins" } }, "objects": [ @@ -86,6 +86,21 @@ "resources": {} }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "jenkins" + ], + "from": { + "kind": "ImageStreamTag", + "name": "jenkins:latest", + "namespace": "openshift" + }, + "lastTriggeredImage": "" + } + }, { "type": "ConfigChange" } @@ -155,11 +170,6 @@ "generate": "expression", "value": "password" }, - { - "name": "JENKINS_IMAGE", - "description": "Jenkins Docker image to use", - "value": "openshift/jenkins-1-centos7" - }, { "name": "VOLUME_CAPACITY", "description": "Volume space available for data, e.g. 512Mi, 2Gi", diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs-mongodb.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs-mongodb.json index 8760b074c..21f943da7 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs-mongodb.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs-mongodb.json @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { @@ -228,6 +231,20 @@ "type": "Recreate" }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "mongodb" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "mongodb:2.6" + } + } + }, { "type": "ConfigChange" } @@ -247,7 +264,7 @@ "containers": [ { "name": "mongodb", - "image": "${MONGODB_IMAGE}", + "image": "mongodb", "ports": [ { "containerPort": 27017 @@ -336,11 +353,6 @@ "description": "Password for the database admin user", "generate": "expression", "from": "[a-zA-Z0-9]{16}" - }, - { - "name": "MONGODB_IMAGE", - "description": "Image to use for mongodb", - "value": "openshift/mongodb-24-centos7" } ] } diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs.json index e047266e3..1e301c076 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs.json @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { diff --git a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/rails-postgresql.json b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/rails-postgresql.json index b98282528..5dcbbc729 100644 --- a/roles/openshift_examples/files/examples/v1.1/quickstart-templates/rails-postgresql.json +++ b/roles/openshift_examples/files/examples/v1.1/quickstart-templates/rails-postgresql.json @@ -83,7 +83,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "ruby:2.0" + "name": "ruby:2.2" } } }, @@ -97,6 +97,9 @@ { "type": "ImageChange" }, + { + "type": "ConfigChange" + }, { "type": "GitHub", "github": { @@ -261,6 +264,20 @@ "type": "Recreate" }, "triggers": [ + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": false, + "containerNames": [ + "postgresql" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "openshift", + "name": "postgresql:9.4" + } + } + }, { "type": "ConfigChange" } @@ -280,7 +297,7 @@ "containers": [ { "name": "postgresql", - "image": "${POSTGRESQL_IMAGE}", + "image": "postgresql", "ports": [ { "containerPort": 5432 @@ -383,15 +400,10 @@ "description": "database name", "value": "root" }, - { - "name": "POSTGRESQL_IMAGE", - "description": "Image to use for postgresql", - "value": "openshift/postgresql-92-centos7" - }, { "name": "POSTGRESQL_MAX_CONNECTIONS", "description": "database max connections", - "value": "10" + "value": "100" }, { "name": "POSTGRESQL_SHARED_BUFFERS", -- cgit v1.2.3