导入示例模板

版本 日期 状态 修订人 摘要
V1.0 2018-04-27 创建 开源方案 初始版本

导入模板和镜像(导入了部分模板)

本节的所涉及到的操作都是在openshift master节点上操作

导入基础镜像(S2I RUNTIME)

oc project openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/image-streams/image-streams-centos7.json -n openshift
imagestream "httpd" created
imagestream "ruby" created
imagestream "nodejs" created
imagestream "perl" created
imagestream "php" created
imagestream "python" created
imagestream "wildfly" created
imagestream "mysql" created
imagestream "mariadb" created
imagestream "postgresql" created
imagestream "mongodb" created
imagestream "redis" created
imagestream "jenkins" created

导入应用模板(openshift项目中)

oc project openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/mariadb-ephemeral-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/mariadb-persistent-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/mongodb-ephemeral-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/mongodb-persistent-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/mysql-ephemeral-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/mysql-persistent-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/redis-ephemeral-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/db-templates/redis-persistent-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/quickstart-templates/cakephp-mysql.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/quickstart-templates/cakephp-mysql-persistent.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/quickstart-templates/jenkins-ephemeral-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/quickstart-templates/jenkins-persistent-template.json -n openshift
oc create -f https://raw.githubusercontent.com/openshift/openshift-ansible/release-3.6/roles/openshift_examples/files/examples/v3.6/quickstart-templates/httpd.json -n openshift

查看导入的镜像列表

[root@openshift-master ~]# oc project openshift
Now using project "openshift" on server "https://192.168.124.22:8443".
[root@openshift-master ~]#  oc get is -n openshift
NAME         DOCKER REPO                                TAGS                           UPDATED
httpd        172.30.111.126:5000/openshift/httpd        latest,2.4                     About an hour ago
jenkins      172.30.111.126:5000/openshift/jenkins      latest,1,2                     About an hour ago
mariadb      172.30.111.126:5000/openshift/mariadb      10.1,latest                    About an hour ago
mongodb      172.30.111.126:5000/openshift/mongodb      2.4,latest,3.2 + 1 more...     About an hour ago
mysql        172.30.111.126:5000/openshift/mysql        latest,5.7,5.6 + 1 more...     About an hour ago
nodejs       172.30.111.126:5000/openshift/nodejs       latest,0.10,4 + 1 more...      About an hour ago
perl         172.30.111.126:5000/openshift/perl         latest,5.24,5.20 + 1 more...   About an hour ago
php          172.30.111.126:5000/openshift/php          5.5,latest,7.0 + 1 more...     About an hour ago
postgresql   172.30.111.126:5000/openshift/postgresql   latest,9.5,9.4 + 1 more...     About an hour ago
python       172.30.111.126:5000/openshift/python       latest,3.5,3.4 + 2 more...     About an hour ago
redis        172.30.111.126:5000/openshift/redis        latest,3.2                     About an hour ago
ruby         172.30.111.126:5000/openshift/ruby         2.3,2.2,2.0 + 1 more...        About an hour ago
wildfly      172.30.111.126:5000/openshift/wildfly      latest,10.1,10.0 + 2 more...   About an hour ago

查看导入的应用模板列表(相当于企业内部的APPSTORE 应用市场)

[root@openshift-master ~]# oc get templates -n openshift
NAME                       DESCRIPTION                                                                        PARAMETERS        OBJECTS
cakephp-mysql-example      An example CakePHP application with a MySQL database. For more information ab...   19 (4 blank)      8
cakephp-mysql-persistent   An example CakePHP application with a MySQL database. For more information ab...   20 (4 blank)      9
httpd-example              An example Httpd application that serves static content. For more information...   9 (3 blank)       5
jenkins-ephemeral          Jenkins service, without persistent storage....                                    7 (all set)       6
jenkins-persistent         Jenkins service, with persistent storage....                                       8 (all set)       7
mariadb-ephemeral          MariaDB database service, without persistent storage. For more information ab...   7 (3 generated)   3
mariadb-persistent         MariaDB database service, with persistent storage. For more information about...   8 (3 generated)   4
mongodb-ephemeral          MongoDB database service, without persistent storage. For more information ab...   8 (3 generated)   3
mongodb-persistent         MongoDB database service, with persistent storage. For more information about...   9 (3 generated)   4
mysql-ephemeral            MySQL database service, without persistent storage. For more information abou...   8 (3 generated)   3
mysql-persistent           MySQL database service, with persistent storage. For more information about u...   9 (3 generated)   4
redis-ephemeral            Redis in-memory data structure store, without persistent storage. For more in...   5 (1 generated)   3
redis-persistent           Redis in-memory data structure store, with persistent storage. For more infor...   6 (1 generated)   4