RHCA之路---EX280(4)

RHCA之路—EX280(4)

1. 题目

在这里插入图片描述
Use the S2I functionality of your OpenShift instance to build an application in the rome project
Use the Git repository at http://services.lab.example.com/php-helloworld for the application source
Use the Docker image labeled registry.lab.example.com/rhscl/php-70-rhel7
Once deployed, the application must be reachable(and browseable)at the following address: http://hellophp.apps.lab.example.com
Update the original repository so that the index.php file contains the text from http://materials.example.com/exam280/mordor.txt instead of the word PHP
Trigger a rebuild so that when browsing http://hellophp.apps.lab.example.com it will display the new text

2. 解题

2.1 切换项目

一定要确认切换到了题目对应的项目,否则这题没分.

[root@master ~]# oc project rome
Now using project "rome" on server "https://master.lab.example.com".
[root@master ~]# mkdir ~/rome
[root@master ~]# cd ~/rome
[root@master rome]# oc projects
You have access to the following projects and can switch between them with 'oc project <projectname>':defaultdittofarmkube-publickube-service-catalogkube-systemloggingmanagement-infraopenshiftopenshift-ansible-service-brokeropenshift-infraopenshift-nodeopenshift-template-service-brokeropenshift-web-console* romesamplesshrimp

2.2 创建app

[root@master rome]# oc new-app registry.lab.example.com/rhscl/php-70-rhel7~http://services.lab.example.com/php-helloworld
--> Found Docker image c101534 (6 years old) from registry.lab.example.com for "registry.lab.example.com/rhscl/php-70-rhel7"Apache 2.4 with PHP 7.0-----------------------PHP 7.0 available as docker container is a base platform for building and running various PHP 7.0 applications and frameworks. PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts.Tags: builder, php, php70, rh-php70* An image stream will be created as "php-70-rhel7:latest" that will track the source image* A source build using source code from http://services.lab.example.com/php-helloworld will be created* The resulting image will be pushed to image stream "php-helloworld:latest"* Every time "php-70-rhel7:latest" changes a new build will be triggered* This image will be deployed in deployment config "php-helloworld"* Port 8080/tcp will be load balanced by service "php-helloworld"* Other containers can access this service through the hostname "php-helloworld"--> Creating resources ...imagestream "php-70-rhel7" createdimagestream "php-helloworld" createdbuildconfig "php-helloworld" createddeploymentconfig "php-helloworld" createdservice "php-helloworld" created
--> SuccessBuild scheduled, use 'oc logs -f bc/php-helloworld' to track its progress.Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:'oc expose svc/php-helloworld'Run 'oc status' to view your app.

2.3 创建app路由

[root@master rome]# oc expose svc/php-helloworld --hostname=hellophp.apps.lab.example.com
route "php-helloworld" exposed

2.4 克隆项目

[root@master rome]# git clone registry.lab.example.com/rhscl/php-70-rhel7
fatal: repository 'registry.lab.example.com/rhscl/php-70-rhel7' does not exist
[root@master rome]# git clone http://services.lab.example.com/php-helloworld
Cloning into 'php-helloworld'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
[root@master rome]# cd php-helloworld/
[root@master php-helloworld]# curl http://materials.example.com/exam280/mordor.txt
exam280

2.5 修改index.html并长传

[root@master php-helloworld]# cat index.php
<?php
print "exam280\n";
?>
[root@master php-helloworld]# git add .
[root@master php-helloworld]# git commit -m 4
[master d0d382a] 4Committer: root <root@master.lab.example.com>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:git config --global user.name "Your Name"git config --global user.email you@example.comAfter doing this, you may fix the identity used for this commit with:git commit --amend --reset-author1 file changed, 1 insertion(+), 1 deletion(-)
[root@master php-helloworld]# git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:git config --global push.default simpleSee 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1/1), done.
Writing objects: 100% (3/3), 264 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://services.lab.example.com/php-helloworld6d61e75..d0d382a  master -> master
[root@master php-helloworld]# git config --global user.name "qiuqin"
[root@master php-helloworld]# git config --global user.email 199@199.com
[root@master php-helloworld]# git config --global push.default simple

2.6 重构应用

[root@master php-helloworld]# oc start-build php-helloworld
build "php-helloworld-2" started

3. 确认

[root@master php-helloworld]# curl http://hellophp.apps.lab.example.com
exam280
[root@master php-helloworld]# oc get pods
NAME                     READY     STATUS      RESTARTS   AGE
php-helloworld-1-build   0/1       Completed   0          9m
php-helloworld-2-build   0/1       Completed   0          1m
php-helloworld-2-dmncr   1/1       Running     0          1m
[root@master php-helloworld]# oc get svc
NAME             TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
php-helloworld   ClusterIP   172.30.55.47   <none>        8080/TCP   9m
[root@master php-helloworld]# oc get route
NAME             HOST/PORT                       PATH      SERVICES         PORT       TERMINATION   WILDCARD
php-helloworld   hellophp.apps.lab.example.com             php-helloworld   8080-tcp                 None

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/97282.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Windows 安装 RabbitMq

Windows 上安装 RabbitMQ 的步骤 RabbitMQ 是一个强大的开源消息队列系统&#xff0c;广泛用于构建分布式、可扩展的应用程序。本教程将带您一步一步完成在 Windows 系统上安装 RabbitMQ 的过程。无需担心&#xff0c;即使您是初学者&#xff0c;也能够轻松跟随这些简单的步骤…

数字生意 经“九”长兴 | 秦丝9周年荣誉盘点

数字生意 经“九”长兴 转眼间&#xff0c;秦丝已经成立了9年 帮助200万商家实现数字化转型 在数字生意的道路上经“九”长兴 9年来&#xff0c;秦丝深入全国各地服装市场调研 9年来&#xff0c;秦丝结合百万商家建议不断更新 9年来&#xff0c;秦丝产品和服务市场好评率9…

ELK安装、部署、调试(六) logstash的安装和配置

1.介绍 Logstash是具有实时流水线能力的开源的数据收集引擎。Logstash可以动态统一不同来源的数据&#xff0c;并将数据标准化到您选择的目标输出。它提供了大量插件&#xff0c;可帮助我们解析&#xff0c;丰富&#xff0c;转换和缓冲任何类型的数据。 管道&#xff08;Logs…

html2canvas 截图空白 或出现toDataURL‘ on ‘HTMLCanvasElement或img标签没截下来 的所有解决办法

1.如果截图空白&#xff1a; 1.1以下的参数是必须要有的。 width: shareContent.offsetWidth, //设置canvas尺寸与所截图尺寸相同&#xff0c;防止白边height: shareContent.offsetHeight, //防止白边logging: true,useCORS: true,x:0,y:0,2&#xff0c;如果出现了报错 toData…

使命召唤中将启用AI检测仇恨言论!

“ToxMod”将自动标记口头骚扰、欺凌和歧视。 周三&#xff0c;动视宣布的它将在即将于11月10日发布的中引入实时人工智能语音聊天调节功能使命召唤:现代战争3。该公司正与调整为了实现这一特性&#xff0c;我们使用了一种叫做托西莫德识别仇恨言论、欺凌、骚扰和歧视并采取行动…

线性代数的学习和整理16:什么是各种空间(类型),向量空间,距离(类型)?

目录 1 空间相关的群&#xff0c;环&#xff0c;域&#xff0c;集合&#xff0c;空间的预备知识 1.1&#xff1a;群&#xff0c;环&#xff0c;域&#xff0c;集合&#xff0c;空间的定义&#xff08;表示不懂&#xff0c;只是做个标记&#xff09; 2 空间 2.1 各种空间概念…

Unity 之 方括号[ ] 的用法以及作用

文章目录 在Unity中&#xff0c;方括号 [ ] 通常用于表示属性、特性&#xff08;Attributes&#xff09;或者元数据&#xff08;Metadata&#xff09;。这些标记提供了附加信息&#xff0c;可以用于修改类、方法、字段等的行为或者在编辑器中进行设置。 以下是一些常见的用法&…

CSS中如何实现文字渐变色效果(Text Gradient Color)?

聚沙成塔每天进步一点点 ⭐ 专栏简介⭐ 文字渐变色效果&#xff08;Text Gradient Color&#xff09;⭐ 写在最后 ⭐ 专栏简介 前端入门之旅&#xff1a;探索Web开发的奇妙世界 记得点击上方或者右侧链接订阅本专栏哦 几何带你启航前端之旅 欢迎来到前端入门之旅&#xff01;这…

哈希表与有序表

哈希表与有序表 Set结构 key Map结构 key-value 哈希表 哈希表的时间复杂度都是常数项级别的&#xff0c;但常数较大 增删改查的时间都是常数级别的&#xff0c;与数据量无关 当哈希表存储的值是基础数据类型&#xff08;Integer - int&#xff09;&#xff0c;哈希表中内…

list根据对象中某个字段属性去重Java流实现

list根据对象中某个字段属性去重Java流实现&#xff1f; 在Java的流(Stream)中&#xff0c;你可以使用distinct方法来实现根据对象中某个字段属性去重的功能。要实现这个功能&#xff0c;你需要重写对象的hashCode和equals方法&#xff0c;以确保相同字段属性的对象被认为是相…

学习Linux基础知识与命令行操作

开始学习Linux系统前&#xff0c;首先要掌握计算机基础知识&#xff0c;了解硬件、操作系统、文件系统、网络和安全等概念。对这些基础知识的了解能够帮助理解Linux系统的概念和功能。 在Linux系统中&#xff0c;文件和目录是数据管理的基本单位。每个文件和目录都有一个称为&…

python webdriver 测试框架数据驱动json文件驱动的方式

简介&#xff1a; 数据驱动excel驱动方式,就是数据配置在excel里面&#xff0c;主程序调用的时候每次用从excel里取出的数据作为参数&#xff0c;进行操作&#xff0c; 需要掌握的地方是对excel的操作&#xff0c;要灵活的找到目标数据 测试数据.xlsx: 路径-D:\test\0627 E…