[student@workstation ~]$ oc get templates -n openshift NAME DESCRIPTION PARAMETERS OBJECTS cakephp-mysql-example An example CakePHP application with a MySQL database. For more information ab... 21 (4 blank) 8 cakephp-mysql-persistent An example CakePHP application with a MySQL database. For more information ab... 22 (4 blank) 9 dancer-mysql-example An example Dancer application with a MySQL database. For more information abo... 18 (5 blank) 8 dancer-mysql-persistent An example Dancer application with a MySQL database. For more information abo... 19 (5 blank) 9 django-psql-example An example Django application with a PostgreSQL database. For more informatio... 19 (5 blank) 8 django-psql-persistent An example Django application with a PostgreSQL database. For more informatio... 20 (5 blank) 9 httpd-example An example Apache HTTP Server (httpd) application that serves static content.... 10 (3 blank) 5 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 nodejs-postgresql-example An example Node.js application with a PostgreSQL database. For more informati... 18 (4 blank) 8 nodejs-postgresql-persistent An example Node.js application with a PostgreSQL database. For more informati... 19 (4 blank) 9 postgresql-ephemeral PostgreSQL database service, without persistent storage. For more information... 7 (2 generated) 3 postgresql-persistent PostgreSQL database service, with persistent storage. For more information ab... 8 (2 generated) 4
[student@workstation ~]$ oc describe template httpd-example -n openshift Name: httpd-example Namespace: openshift Created: 13 months ago Labels: samples.operator.openshift.io/managed=true Description: An example Apache HTTP Server (httpd) application that serves static content. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/httpd-ex/blob/master/README.md. Annotations: iconClass=icon-apache openshift.io/display-name=Apache HTTP Server openshift.io/documentation-url=https://github.com/sclorg/httpd-ex openshift.io/long-description=This template defines resources needed to develop a static application served by Apache HTTP Server (httpd), including a build configuration and application deployment configuration. openshift.io/provider-display-name=Red Hat, Inc. openshift.io/support-url=https://access.redhat.com samples.operator.openshift.io/version=4.12.0 tags=quickstart,httpd template.openshift.io/bindable=false
Parameters: Name: NAME Display Name: Name Description: The name assigned to all of the frontend objects defined in this template. Required: true Value: httpd-example
Name: NAMESPACE Display Name: Namespace Description: The OpenShift Namespace where the ImageStream resides. Required: true Value: openshift
Name: HTTPD_VERSION Display Name: HTTPD Version Description: Version of HTTPD image to be used (2.4-el8 by default). Required: true Value: 2.4-el8
Name: MEMORY_LIMIT Display Name: Memory Limit Description: Maximum amount of memory the container can use. Required: true Value: 512Mi
Name: SOURCE_REPOSITORY_URL Display Name: Git Repository URL Description: The URL of the repository with your application source code. Required: true Value: https://github.com/sclorg/httpd-ex.git
Name: SOURCE_REPOSITORY_REF Display Name: Git Reference Description: Set this to a branch name, tag or other ref of your repository if you are not using the default branch. Required: false Value: <none>
Name: CONTEXT_DIR Display Name: Context Directory Description: Set this to the relative path to your project if it is not in the root of your repository. Required: false Value: <none>
Name: APPLICATION_DOMAIN Display Name: Application Hostname Description: The exposed hostname that will route to the httpd service, if left blank a value will be defaulted. Required: false Value: <none>
Name: GITHUB_WEBHOOK_SECRET Display Name: GitHub Webhook Secret Description: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted. Required: false Generated: expression From: [a-zA-Z0-9]{40}
Name: GENERIC_WEBHOOK_SECRET Display Name: Generic Webhook Secret Description: A secret string used to configure the Generic webhook. Required: false Generated: expression From: [a-zA-Z0-9]{40}
[student@workstation ~]$ oc process --parameters httpd-example -n openshift NAME DESCRIPTION GENERATOR VALUE NAME The name assigned to all of the frontend objects defined in this template. httpd-example NAMESPACE The OpenShift Namespace where the ImageStream resides. openshift HTTPD_VERSION Version of HTTPD image to be used (2.4-el8 by default). 2.4-el8 MEMORY_LIMIT Maximum amount of memory the container can use. 512Mi SOURCE_REPOSITORY_URL The URL of the repository with your application source code. https://github.com/sclorg/httpd-ex.git SOURCE_REPOSITORY_REF Set this to a branch name, tag or other ref of your repository if you are not using the default branch. CONTEXT_DIR Set this to the relative path to your project if it is not in the root of your repository. APPLICATION_DOMAIN The exposed hostname that will route to the httpd service, if left blank a value will be defaulted. GITHUB_WEBHOOK_SECRET Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted. expression [a-zA-Z0-9]{40} GENERIC_WEBHOOK_SECRET A secret string used to configure the Generic webhook. expression [a-zA-Z0-9]{40}
Apache HTTP Server --------- An example Apache HTTP Server (httpd) application that serves static content. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/httpd-ex/blob/master/README.md.
The following service(s) have been created in your project: lixiaohui.
For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/httpd-ex/blob/master/README.md.
--> Creating resources ... service "lixiaohui" created route.route.openshift.io "lixiaohui" created imagestream.image.openshift.io "lixiaohui" created buildconfig.build.openshift.io "lixiaohui" created deploymentconfig.apps.openshift.io "lixiaohui" created --> Success Access your application via route 'lixiaohui-default.apps.ocp4.example.com' Build scheduled, use 'oc logs -f buildconfig/lixiaohui' to track its progress. Run 'oc status' to view your app.
查看部署的过程
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[student@workstation ~]$ oc status --suggest In project default on server https://api.ocp4.example.com:6443
http://lixiaohui-default.apps.ocp4.example.com (svc/lixiaohui) dc/lixiaohui deploys istag/lixiaohui:latest <- bc/lixiaohui source builds https://github.com/sclorg/httpd-ex.git on openshift/httpd:2.4-el8 deployment #1 deployed about a minute ago - 1 pod