Bläddra i källkod

Update sync db-templates, image-streams, and quickstart-templates

Scott Dodson 9 år sedan
förälder
incheckning
aab6d7dd10
17 ändrade filer med 259 tillägg och 67 borttagningar
  1. 100 0
      roles/openshift_examples/files/examples/v1.1/db-templates/README.md
  2. 1 1
      roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json
  3. 1 1
      roles/openshift_examples/files/examples/v1.1/db-templates/mysql-ephemeral-template.json
  4. 1 1
      roles/openshift_examples/files/examples/v1.1/db-templates/postgresql-ephemeral-template.json
  5. 7 7
      roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-centos7.json
  6. 7 7
      roles/openshift_examples/files/examples/v1.1/image-streams/image-streams-rhel7.json
  7. 19 7
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp-mysql.json
  8. 4 1
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/cakephp.json
  9. 19 7
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer-mysql.json
  10. 4 1
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/dancer.json
  11. 19 7
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/django-postgresql.json
  12. 4 1
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/django.json
  13. 16 6
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-ephemeral-template.json
  14. 16 6
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/jenkins-persistent-template.json
  15. 18 6
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs-mongodb.json
  16. 3 0
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs.json
  17. 20 8
      roles/openshift_examples/files/examples/v1.1/quickstart-templates/rails-postgresql.json

+ 100 - 0
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)

+ 1 - 1
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"
               ],

+ 1 - 1
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"
               ],

+ 1 - 1
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"
               ],

+ 7 - 7
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"
             }
           },
           {

+ 7 - 7
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"
             }
           },
           {

+ 19 - 7
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"
@@ -250,6 +253,20 @@
         },
         "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
@@ -347,11 +364,6 @@
       "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",
       "generate": "expression",

+ 4 - 1
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"

+ 19 - 7
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"
@@ -224,6 +227,20 @@
         },
         "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
@@ -329,11 +346,6 @@
       "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",
       "value": ""

+ 4 - 1
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"

+ 19 - 7
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"
@@ -231,6 +234,20 @@
         },
         "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
@@ -328,11 +345,6 @@
       "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)"
     },

+ 4 - 1
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"

+ 16 - 6
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": [
@@ -70,6 +70,21 @@
         },
         "triggers": [
           {
+            "type": "ImageChange",
+            "imageChangeParams": {
+              "automatic": false,
+              "containerNames": [
+                "jenkins"
+              ],
+              "from": {
+                "kind": "ImageStreamTag",
+                "name": "jenkins:latest",
+                "namespace": "openshift"
+              },
+              "lastTriggeredImage": ""
+            }
+          },
+          {
             "type": "ConfigChange"
           }
         ],
@@ -133,11 +148,6 @@
       "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",
       "generate": "expression",

+ 16 - 6
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": [
@@ -87,6 +87,21 @@
         },
         "triggers": [
           {
+            "type": "ImageChange",
+            "imageChangeParams": {
+              "automatic": true,
+              "containerNames": [
+                "jenkins"
+              ],
+              "from": {
+                "kind": "ImageStreamTag",
+                "name": "jenkins:latest",
+                "namespace": "openshift"
+              },
+              "lastTriggeredImage": ""
+            }
+          },
+          {
             "type": "ConfigChange"
           }
         ],
@@ -156,11 +171,6 @@
       "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",
       "value": "512Mi",

+ 18 - 6
roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs-mongodb.json

@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"
@@ -229,6 +232,20 @@
         },
         "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"
     }
   ]
 }

+ 3 - 0
roles/openshift_examples/files/examples/v1.1/quickstart-templates/nodejs.json

@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"

+ 20 - 8
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"
             }
           }
         },
@@ -98,6 +98,9 @@
             "type": "ImageChange"
           },
           {
+            "type": "ConfigChange"
+          },
+          {
             "type": "GitHub",
             "github": {
               "secret": "${GITHUB_WEBHOOK_SECRET}"
@@ -262,6 +265,20 @@
         },
         "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
@@ -384,14 +401,9 @@
       "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",