使用Sandbox进行快速使用OpenShift的步骤
首先

注册红帽账户。
首先,请从以下URL创建一个RedHat账户。
https://developers.redhat.com/about
开始使用Sandbox
在此期间内,虽然有时间限制,但可以免费使用。
我们将使用开发者沙盒(使用期限为30天)。

安装CLI工具
由于工具根据版本细分,因此首先需要在网页控制台上确认版本。

> oc version
使用CLI工具登录
-
- 访问网页控制台,点击右上角的用户名,然后选择“复制登录命令”
-
- 点击“DevSendBox”
-
- 点击“Deploy Token”
- 复制并在终端中执行显示的命令即可登录成功
> oc login --token=XXXXXXXXXXXXXXXXX --server=https://api.sandbox.x8i5.p1.openshiftapps.com:6443
Logged into "https://api.sandbox.x8i5.p1.openshiftapps.com:6443" as "ユーザ名" using the token provided.
项目创建
可以通过Web控制台或CLI(oc new-project my-project)来创建, 但在Sandbox中,无法创建新项目,因此需要使用已准备好的项目。
尝试使用Web控制台创建应用程序。
我們將部署一個能夠顯示地圖的網絡應用程序。

尝试通过CLI创建应用程序。
我将在Jenkins中尝试构建流水线。
这些步骤是参考百度博客网站的。
- 请在终端上使用以下命令检查模板。
> oc get templates -n openshift
- 在终端使用以下命令创建应用程序。本次选择了Jenkins模板作为显示结果。
> oc new-app jenkins-ephemeral
使用3.yaml文件创建Pod。
> oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/nodejs-sample-pipeline.yaml
执行Jenkins Pipeline的构建。
> oc start-build nodejs-sample-pipeline
5. 检查路线
>oc get routes
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
jenkins jenkins-yuko-kanai-dev.apps.sandbox.x8i5.p1.openshiftapps.com jenkins <all> edge/Redirect None
nodejs-postgresql-example nodejs-postgresql-example-yuko-kanai-dev.apps.sandbox.x8i5.p1.openshiftapps.com nodejs-postgresql-example <all> None
通过访问Route中确认的jenkins的URL(jenkins-yuko-kanai-dev.apps.sandbox.x8i5.p1.openshiftapps.com),可以确认Jenkins。
nodejs-postgresql-example的URL将连接到示例的CRUD应用程序。
其他命令
应用yaml文件(包括从create中使用的yaml文件的更改)。
> oc apply -f pod.yaml
其他一些
最后

非常感谢您。