RHCA之路---EX280(8)

RHCA之路—EX280(8)

1. 题目

在这里插入图片描述
On master.lab.example.com using the template file in http://materials.example.com/exam280/gogs as a basis,
install an application in the ditto project according to the following requirements:
All of the registry entries must point to your local registry at registry.lab.example.com
The version in the ImageStream line for the postgresql image must be changed from postgresql:9.5 to postgresql:9.2
For the Gogs pod, use the Docker image from http://materials.example.com/exam280/gogs.tar and make sure it is tagged as registry.lab.example.com/openshiftdemos/gogs:0.9.97 and pushed to your local registry
Mask the template gogs available across all projects and for all users
Deploy the appllication using the template, setting the parameter HOSTNAME to gogs.apps.lab.example.com
Create a user salvo with password redhat and email address salvo@master.lab.example.com on the application frontend
(use the Register link on the top right of the page at http://gogs.apps.lab.example.com) and, as this user, create a Git repository named ex280
If there isn’t one already, create a file named README.md in the repository ex280 and put the line faber est quisque fortunae suae in it and commit it.
The repository must be visible and accessible

2. 解题

2.1 切换项目

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

2.2 创建模板

2.2.1 下载模板

[root@master ditto]# wget http://materials.example.com/exam280/gogs/gogs-temp.yaml
--2023-09-04 16:33:37--  http://materials.example.com/exam280/gogs/gogs-temp.yaml
Resolving materials.example.com (materials.example.com)... 172.25.254.254
Connecting to materials.example.com (materials.example.com)|172.25.254.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10037 (9.8K) [text/plain]
Saving to: ‘gogs-temp.yaml’100%[===========================================================================================================>] 10,037      --.-K/s   in 0s2023-09-04 16:33:37 (285 MB/s) - ‘gogs-temp.yaml’ saved [10037/10037]

2.2.3 替换yaml

[root@master ditto]# sed -ir 's/postgresql:9.5/postgresql:9.2/g' gogs-temp.yaml
[root@master ditto]# grep gogs: gogs-temp.yamlname: services.lab.example.com/openshiftdemos/gogs:0.9.97
[root@master ditto]# sed -ir 's#services.lab.example.com/openshiftdemos/gogs:0.9.97#registry.lab.example.com/openshiftdemos/gogs:0.9.97#g' gogs-temp.yaml

2.2.4 创建template

[root@master ditto]# oc create -f gogs-temp.yaml -n openshift
template "gogs" created

2.3 创建镜像

[root@master ditto]# wget http://materials.example.com/exam280/gogs.tar
--2023-09-04 16:38:12--  http://materials.example.com/exam280/gogs.tar
Resolving materials.example.com (materials.example.com)... 172.25.254.254
Connecting to materials.example.com (materials.example.com)|172.25.254.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 467157504 (446M) [application/x-tar]
Saving to: ‘gogs.tar’100%[===========================================================================================================>] 467,157,504  106MB/s   in 4.7s2023-09-04 16:38:17 (95.1 MB/s) - ‘gogs.tar’ saved [467157504/467157504][root@master ditto]# docker load -i gogs.tar
34e7b85d83e4: Loading layer [==================================================>] 199.9 MB/199.9 MB
addf85492fbe: Loading layer [==================================================>] 6.144 kB/6.144 kB
126a150d0743: Loading layer [==================================================>] 189.6 MB/189.6 MB
b93687778caa: Loading layer [==================================================>] 77.66 MB/77.66 MB
Loaded image: openshiftdemos/gogs:latest
[root@master ditto]# docker tag openshiftdemos/gogs:latest registry.lab.example.com/openshiftdemos/gogs:0.9.97
[root@master ditto]# docker push registry.lab.example.com/openshiftdemos/gogs:0.9.97
The push refers to a repository [registry.lab.example.com/openshiftdemos/gogs]
b93687778caa: Pushed
126a150d0743: Pushed
addf85492fbe: Pushed
34e7b85d83e4: Pushed
0.9.97: digest: sha256:483a06aac04eb028ae1ddbd294954ba28d7c16b32fc5fca495f37d8e6c9295de size: 1160

2.4 根据template创建app

[root@master ditto]# oc new-app --template=gogs --param=HOSTNAME=gogs.apps.lab.example.com
--> Deploying template "openshift/gogs" to project dittogogs---------The Gogs git server (https://gogs.io/)* With parameters:* APPLICATION_NAME=gogs* HOSTNAME=gogs.apps.lab.example.com* GOGS_VOLUME_CAPACITY=1Gi* DB_VOLUME_CAPACITY=2Gi* Database Username=gogs* Database Password=gogs* Database Name=gogs* Database Admin Password=605BtU1L # generated* Maximum Database Connections=100* Shared Buffer Amount=12MB* Gogs Version=0.9.97* Installation lock=true* Skip TLS verification on webhooks=false--> Creating resources ...persistentvolume "gogs-postgres-data" createdpersistentvolume "gogs-data" createdserviceaccount "gogs" createdservice "gogs-postgresql" createddeploymentconfig "gogs-postgresql" createdservice "gogs" createdroute "gogs" createddeploymentconfig "gogs" createdimagestream "gogs" createdpersistentvolumeclaim "gogs-data" createdpersistentvolumeclaim "gogs-postgres-data" createdconfigmap "gogs-config" created
--> SuccessAccess your application via route 'gogs.apps.lab.example.com'Run 'oc status' to view your app.

2.5 创建git仓库

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

2.6 git clone

[root@master ditto]# git clone http://gogs.apps.lab.example.com/salvo/ex280.git
Cloning into 'ex280'...
warning: You appear to have cloned an empty repository.
[root@master ditto]# cd ex280/
[root@master ex280]# vim README.md
[root@master ex280]# cat README.md
faber est quisque fortunae suae
[root@master ex280]# git add .
[root@master ex280]# git commit -m 8
[master (root-commit) 5f37403] 81 file changed, 1 insertion(+)create mode 100644 README.md
[root@master ex280]# git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 229 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
Username for 'http://gogs.apps.lab.example.com': salvo
Password for 'http://salvo@gogs.apps.lab.example.com':redhat
To http://gogs.apps.lab.example.com/salvo/ex280.git* [new branch]      master -> master

3. 确认

刷新git仓库,可以看到README.md已经被提交
在这里插入图片描述

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

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

相关文章

微信小程序源码【195套】【源码导入视频教程+源码导入文档教程+详细图文文档教程】

一、项目说明 盒马鲜生.zip 轻客洗衣.zip 云文档.zip 仿ofo共享单车.zip 仿美团外卖.zip 仿饿了么.zip 灵犀外卖.zip 小契约&#xff08;交友互动小程序&#xff09;.zip 信息科技公司展示小程序.zip 华云智慧园区.zip 房地产公司展示.zip 企业OA系统小程序.zip 优惠券卡卷小程…

整理mongodb文档:事务(一)

个人博客 整理mongodb文档:事务(一) 原文链接&#xff0c;个人博客 求关注&#xff0c;本文主要讲下怎么在mongose下使用事务&#xff0c;建议电脑端看 文章概叙 本文的开发环境为Nodejs&#xff0c;在‘单机模式’讲解最基本的事务概念。并没有涉及分片以及集群&#xff0…

ESP32C3 LuatOS RC522②写入字符串

编写了字符串转16进制表函数 -- 将字符串转换为十六进制表 local function stringToHexTable(str)local hexTable {}local maxLength 16 -- 最大长度为16个元素-- 将字符串转换为十六进制for i 1, #str doif i > maxLength thenbreakendlocal hex string.format("…

QT第一天

创建登录界面 #include "widget.h" #include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget) {ui->setupUi(this);this->setFixedSize(700,800);//1.实例化一个标签,设置上面界面QLabel *lab1 new QLabel(th…

ElementUI浅尝辄止16:Tag 标签

用于标记和选择。 1.如何使用&#xff1f; 由type属性来选择tag的类型&#xff0c;也可以通过color属性来自定义背景色。<el-tag>标签一</el-tag> <el-tag type"success">标签二</el-tag> <el-tag type"info">标签三</e…

基于Mendix移动原生的离线应用

一、前言 不同行业的企业会有特殊的业务场景&#xff0c;比如某些制造业的企业的工厂是物理隔离的&#xff0c;但工程师需要拿着平板输入很多生产数据&#xff1b;某些煤炭和矿业企业&#xff0c;在实际的工作区都是比较偏远&#xff0c;信号比较差&#xff0c;但是又需要用手…

简单记录下gin中使用中间件记录操作日志

1、直接定义中间件package middlewareimport ("bytes""encoding/json""fmt""github.com/gin-gonic/gin""go.uber.org/zap""io""strconv""strings" )func LoggerMiddleWare() gin.HandlerFunc…

golang中如何判断字符串是否包含另一字符串

golang中如何判断字符串是否包含另一字符串 在Go语言中&#xff0c;可以使用strings.Contains()函数来判断一个字符串是否包含另一个字符串。该函数接受两个参数&#xff1a;要搜索的字符串和要查找的子字符串&#xff0c;如果子字符串存在于要搜索的字符串中&#xff0c;则返…

【python技巧】替换文件中的某几行

【python技巧】替换文件中的某几行 1. 背景描述2. 单行修改-操作步骤3. 多行修改-操作步骤 1. 背景描述 最近在写一个后端项目&#xff0c;主要的操作就是根据用户的前端数据&#xff0c;在后端打开项目中的代码文件&#xff0c;修改对应位置的参数&#xff0c;因为在目前的后…

快速搭建IntelliJ IDEA开发环境的完整教程

添加链接描述 Mysql 安装流程 常见问题 一、环境配置了很久了&#xff0c;不知道装没装过Mysql&#xff1f; 三种方法查&#xff1a;1. cmd中指令where is mysql 2.windows 环境变量中找MYSQL_HOME 3. 打开MySQL的配置文件my.cnf&#xff08;Windows系统路径为C:\ProgramDat…

浏览器安全-同源策略和CORS

同源策略 同源策略是浏览器的一个安全功能&#xff0c;浏览器禁止在当前域读写其他域的资源&#xff0c;如限制跨域发送ajax请求 不受同源策略限制的 1&#xff09;页面中的链接&#xff0c;重定向表单以及表单提交 2&#xff09;跨域资源引入 如script不受跨域限制&#xff0…

Elasticsearch:wildcard - 通配符搜索

Elasticsearch 是一个分布式、免费和开放的搜索和分析引擎&#xff0c;适用于所有类型的数据&#xff0c;例如文本、数字、地理空间、结构化和非结构化数据。 它基于 Apache Lucene 构建&#xff0c;Apache Lucene 是一个全文搜索引擎&#xff0c;可用于各种编程语言。 由于其速…

远程工作面试:特殊情况下的面试技巧

&#x1f337;&#x1f341; 博主猫头虎&#xff08;&#x1f405;&#x1f43e;&#xff09;带您 Go to New World✨&#x1f341; &#x1f984; 博客首页——&#x1f405;&#x1f43e;猫头虎的博客&#x1f390; &#x1f433; 《面试题大全专栏》 &#x1f995; 文章图文…

【Vue3 知识第四讲】数据双向绑定、事件绑定、事件修饰符详解

文章目录 一、数据双向绑定二、事件绑定详解2.1 **Vue中的事件绑定指令**2.2 **事件函数的调用方式**2.3 **事件函数参数传递** 三、事件修饰符3.1 **Vue中常用的事件修饰符**3.2 **按键修饰符** 四、属性绑定五、类与样式的绑定5.1 class 类的绑定5.2 style 样式绑定 一、数据…

代码随想录二刷day16

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、力扣104. 二叉树的最大深度二、力扣559. N 叉树的最大深度三、力扣111. 二叉树的最小深度三、力扣力扣222. 完全二叉树的节点个数 前言 一、力扣104. 二叉树…

centos7安装php

在 CentOS 7 上使用 Remi 仓库安装 PHP 7.4&#xff0c;您可以按照以下步骤操作 1. 安装 EPEL 仓库&#xff1a; yum install -y epel-release 2. 安装 Remi 仓库&#xff1a; sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm 3. 启用 Remi 仓…

消息队列(MQ)面试

目录 讲一讲MQ 面试官: 在你之前的项目中&#xff0c;你是否使用过消息队列&#xff08;MQ&#xff09;&#xff1f;能详细介绍一下你在项目中如何使用MQ吗&#xff1f; 在用户和用户之间的多对多聊天通信中如何使用&#xff0c;请具体来讲一下。 那你可以讲一下消息的确认…

一文了解Android App Bundle 格式文件

1. Android App Bundle 是什么&#xff1f; 从 2021 年 8 月起&#xff0c;新应用需要使用 Android App Bundle 才能在 Google Play 中发布。 Android App Bundle是一种发布格式&#xff0c;打包出来的格式为aab&#xff0c;而之前我们打包出来的格式为apk。编写完代码之后&a…

Spring中依赖注入的继承bean的细节问题

介绍 有时我们会对一种类型的bean进行继承&#xff0c;在Spring生成bean的时候&#xff0c;返回类型有时是子类类型&#xff0c;有时会父类类型。那么到底在什么情况下用哪种类型呢&#xff1f;肯定有不少人会忽略这点&#xff0c;本篇文章就是把这个细节讲清楚 案例 父类Ba…

uni-app语音转文字功能demo(同声传译)

目录 首先去微信开发者官网申请一下同声传译的插件 微信公众平台 在文件中开始引用&#xff1a; 首先去微信开发者官网申请一下同声传译的插件 微信公众平台 后续使用的时候可以看详情里面的信息进行使用 在文件中开始引用&#xff1a; 注意&#xff01;&#xff01;在这个…