当前位置: 首页 > news >正文

RHCA之路---EX280(5)

RHCA之路—EX280(5)

1. 题目

在这里插入图片描述
Using the example files from the wordpress directory under
http://materials.example.com/exam280/wordpress create a WordPress application in the farm project
For permanent storage use the NFS shares /exports/wordpress and /exports/mysql from services.lab.example.com.
Use the files from http://materials.example.com/exam280/wordpress for the volumes
For the WordPress pod, use the Docker image from
http://materials.example.com/exam280/wordpress.tar
(Note: it is normal if the WordPress pod initially restarts a couple of times due to permaission issues)
For the MySQL pod use the Docker image rhscl/mysql-57-rhel7
Once deployed,the application must be reachable at the following address:
http://blog.apps.lab.example.com
Finally, complete the WordPress installation by setting ayumi as the admin user with password redhat and ayumi@master.lab.example.com for the email address
Set the blog name to EX280 Blog
Create your first post with title faber est quisque fortunae suae.
The text in the post does not matter

2. 解题

2.1 切换项目

切记一定不要漏这步

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

2.2 下载模板文件

wget http://materials.example.com/exam280/wordpress/pv.yaml
wget http://materials.example.com/exam280/wordpress/pvc.yaml
wget http://materials.example.com/exam280/wordpress/pod-mysql.yaml
wget http://materials.example.com/exam280/wordpress/pod-wordpress.yaml
wget http://materials.example.com/exam280/wordpress/service-mysql.yaml
wget http://materials.example.com/exam280/wordpress/service-wp.yaml
cp pv.yaml mypv.yaml
cp pvc.yaml mypvc.yaml
cp pv.yaml wppv.yaml
cp pvc.yaml wppvc.yaml

2.3 配置mysql

2.3.1 mypv.yaml

apiVersion: v1
kind: PersistentVolume
metadata:name: mypv
spec:capacity:storage: 3GiaccessModes:- ReadWriteOncenfs:path: /exports/mysqlserver: services.lab.example.compersistentVolumeReclaimPolicy: Recycle

2.3.2 mypvc.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: dbclaim
spec:accessModes:- ReadWriteOnceresources:requests:storage: 3Gi

2.3.3 pod-mysql.yaml

apiVersion: v1
kind: Pod
metadata:name: mysqllabels:name: mysql
spec:containers:- image: registry.lab.example.com/rhscl/mysql-57-rhel7:latestname: mysqlenv:- name: MYSQL_ROOT_PASSWORDvalue: redhat- name: MYSQL_USERvalue: tom- name: MYSQL_PASSWORDvalue: redhat- name: MYSQL_DATABASEvalue: blogports:- containerPort: 3306name: mysqlvolumeMounts:- name: mysql-persistent-storagemountPath: /var/lib/mysql/datavolumes:- name: mysql-persistent-storagepersistentVolumeClaim:claimName: dbclaim

2.3.4 service-mysql.yaml

apiVersion: v1
kind: Service
metadata:labels:name: mysqlname: mysql
spec:ports:# the port that this service should serve on- port: 3306# label keys and values that must match in order to receive traffic for this serviceselector:name: mysql

2.3.5 创建mysql

[root@master farm]# oc create -f mypv.yaml
persistentvolume "mypv" created
[root@master farm]# oc create -f mypvc.yaml
persistentvolumeclaim "dbclaim" created
[root@master farm]# oc create -f pod-mysql.yaml
pod "mysql" created
[root@master farm]# oc create -f service-mysql.yaml
service "mysql" created

2.4 配置wordpress

2.4.1 wordpress镜像准备

[root@master farm]# wget http://materials.example.com/exam280/wordpress.tar
--2023-09-04 15:49:32--  http://materials.example.com/exam280/wordpress.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: 419054592 (400M) [application/x-tar]
Saving to: ‘wordpress.tar’100%[===========================================================================================================>] 419,054,592 70.6MB/s   in 5.7s2023-09-04 15:49:38 (70.7 MB/s) - ‘wordpress.tar’ saved [419054592/419054592][root@master farm]# docker load -i wordpress.tar
2c40c66f7667: Loading layer [==================================================>] 129.3 MB/129.3 MB
ddd6dcab19ff: Loading layer [==================================================>] 204.7 MB/204.7 MB
f0c367fa8636: Loading layer [==================================================>] 3.584 kB/3.584 kB
0fd7a67d49b3: Loading layer [==================================================>] 7.699 MB/7.699 MB
53da01089a82: Loading layer [==================================================>] 10.24 kB/10.24 kB
3d2582fdede2: Loading layer [==================================================>] 9.728 kB/9.728 kB
315db89f9acb: Loading layer [==================================================>] 4.096 kB/4.096 kB
2da371244fc1: Loading layer [==================================================>]  7.68 kB/7.68 kB
354b4ef9664b: Loading layer [==================================================>] 13.01 MB/13.01 MB
adfd7c98cdf6: Loading layer [==================================================>] 4.096 kB/4.096 kB
8747705a74d9: Loading layer [==================================================>] 33.01 MB/33.01 MB
5a151fa4136e: Loading layer [==================================================>] 11.78 kB/11.78 kB
c8c6d352c96e: Loading layer [==================================================>] 4.608 kB/4.608 kB
fed26d7fe7b9: Loading layer [==================================================>]  6.04 MB/6.04 MB
4214911d5945: Loading layer [==================================================>] 4.608 kB/4.608 kB
6671cb9eb6b3: Loading layer [==================================================>] 7.168 kB/7.168 kB
562dd11ed871: Loading layer [==================================================>] 25.12 MB/25.12 MB
53e16fa1f104: Loading layer [==================================================>] 10.24 kB/10.24 kB
Loaded image: 192.168.122.250:5000/openshift/wordpress:latest
[root@master farm]# docker tag 192.168.122.250:5000/openshift/wordpress:latest registry.lab.example.com/openshift/wordpress:latest
[root@master farm]# docker push registry.lab.example.com/openshift/wordpress:latest
The push refers to a repository [registry.lab.example.com/openshift/wordpress]
53e16fa1f104: Pushed
562dd11ed871: Pushed
6671cb9eb6b3: Pushed
4214911d5945: Pushed
fed26d7fe7b9: Pushed
c8c6d352c96e: Pushed
5a151fa4136e: Pushed
8747705a74d9: Pushed
adfd7c98cdf6: Pushed
354b4ef9664b: Pushed
2da371244fc1: Pushed
315db89f9acb: Pushed
3d2582fdede2: Pushed
53da01089a82: Pushed
0fd7a67d49b3: Pushed
f0c367fa8636: Pushed
ddd6dcab19ff: Pushed
2c40c66f7667: Pushed
latest: digest: sha256:ca4cf4692b7bebd81f229942c996b1c4e6907d6733e977e93d671a54b8053a22 size: 4078

2.4.2 wppv.yaml

apiVersion: v1
kind: PersistentVolume
metadata:name: wppv
spec:capacity:storage: 4GiaccessModes:- ReadWriteOncenfs:path: /exports/wordpressserver: services.lab.example.compersistentVolumeReclaimPolicy: Recycle

2.4.3 wppvc.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: blogclaim
spec:accessModes:- ReadWriteOnceresources:requests:storage: 4Gi

2.4.4 pod-wordpress.yaml

apiVersion: v1
kind: Pod
metadata:name: wordpresslabels:name: wordpress
spec:containers:- image: registry.lab.example.com/openshift/wordpress:latestname: wordpressenv:- name: WORDPRESS_DB_USERvalue: root- name: WORDPRESS_DB_PASSWORDvalue: redhat- name: WORDPRESS_DB_NAMEvalue: blog- name: WORDPRESS_DB_HOST# this is the name of the mysql service fronting the mysql pod in the same namespace# expands to mysql.<namespace>.svc.cluster.local  - where <namespace> is the current namespacevalue: mysqlports:- containerPort: 80name: wordpressvolumeMounts:- name: wordpress-persistent-storagemountPath: /var/www/htmlvolumes:- name: wordpress-persistent-storagepersistentVolumeClaim:claimName: blogclaim

2.4.5 service-wp.yaml

apiVersion: v1
kind: Service
metadata:labels:name: wpfrontendname: wpfrontend
spec:ports:# the port that this service should serve on- port: 80targetPort: 80# label keys and values that must match in order to receive traffic for this serviceselector:name: wordpress

2.4.6 创建wordpress

[root@master farm]# oc create -f wppv.yaml
persistentvolume "wppv" created
[root@master farm]# oc create -f wppvc.yaml
persistentvolumeclaim "blogclaim" created
[root@master farm]# oc create -f pod-wordpress.yaml
pod "wordpress" created
[root@master farm]# oc create -f service-wp.yaml
service "wpfrontend" created

2.4.7 创建wordpress路由

[root@master farm]# oc expose svc wpfrontend --hostname=blog.apps.lab.example.com
route "wpfrontend" exposed

2.5 配置wordpress

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

3. 确认

在这里插入图片描述
可以看到这个页面基本没问题了
在这里插入图片描述

相关文章:

RHCA之路---EX280(5)

RHCA之路—EX280(5) 1. 题目 Using the example files from the wordpress directory under http://materials.example.com/exam280/wordpress create a WordPress application in the farm project For permanent storage use the NFS shares /exports/wordpress and /export…...

”轻舟已过万重山“-----我回归更新了-----

嘿&#xff0c;朋友们&#xff0c;很久不见&#xff0c;甚是想念&#xff0c;经历过漫长的暑期生活&#xff0c;也许你已然收获满满。有可能你拿到了那梦寐以求的机动车行驶证&#xff0c;开着家长的小车在道路上自由的兜风&#xff1b;有可能你来了一场说走就走的旅行&#xf…...

win11右键菜单恢复win10风格

按 winx 输入以下命令 reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve...

Nginx安装及配置负载均衡

文章目录 官网下载Nginx解压安装常用命令配置负载均衡七层负载均衡nginx的负载均衡语法nginx的负载均衡策略故障下线和备份服务设置proxy_pass参数 官网下载Nginx http://nginx.org/en/download.html 注&#xff1a;下载稳定版&#xff0c;即Stateable Version的&#xff0c;…...

C# OpenCvSharp 通道分离

效果 项目 代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using OpenCvSharp; using OpenCvSharp.Extensions;namespac…...

oracle 自定义存储过程(非常简单明了)

语法说明 CREATE OR REPLACE PROCEDURE 存储过程名字 ( 参数1 IN %TYPE, 参数2 IN %TYPE, 参数3 OUT %TYPE) IS 变量1 %TYPE; 变量2 %TYPE; BEGIN存储过程执行语句块 END 存储过程名字;举例说明 1.举一个简单的例子 定义存储过程 easyProcedure 入参为 两个数 出参为 他们的…...

layui--记录

layui 行点击事件&#xff1a;点了没反应&#xff1f; //监听行工具事件layui.table.on(tool(demo), function (obj) {//alert(222) });原因&#xff1a;检查下id与lay-filter是否一致&#xff1b;id与lay-filter必须一致。 <table id"demo" lay-filter"dem…...

【校招VIP】测试技术考点之单元测试集成测试

考点介绍&#xff1a; 单元测试,集成测试的区别是&#xff1a;方式不同、粒度不同、内容不同。单元测试用用于验证编码单元的正确性。集成测试用于验证详细设计。体现了测试由小到大、又内至外、循序渐进的测试过程和分而治之的思想。 测试技术考点之单元测试&集成测试-相…...

【Redis专题】Redis核心数据结构实战与高性能原理解析

目录 前言课程内容一、redis数据类型1.1 字符串&#xff08;string&#xff09;类型&#xff1a;比较简单的一种使用存储模型常用命令&#xff1a;&#xff08;截取自【菜鸟教程】&#xff09;部分演示应用场景 1.2 哈希&#xff08;hash&#xff09;类型&#xff1a;同类数据归…...

常见的几种排序算法

目录 一、插入排序 1、直接插入排序 1.1、排序方法 1.2、图解分析 1.3、代码实现 2、希尔排序 2.1、排序方法 2.2、图解分析 2.3、代码实现 二、选择排序 1、直接选择排序 1.1、排序方法 1.2、图解分析 1.3、代码实现 2、堆排序 2.1、排序方法 2.2、图解分析 …...

动态贴纸、美颜SDK与AR:创造独特的互动体验

目前&#xff0c;动态贴纸、美颜SDK、增强现实&#xff08;AR&#xff09;等技术是比较热门的话题&#xff0c;它们所结合的新兴玩法更是收到大家推崇&#xff0c;正潜移默化的改变我们与数字世界互动的方式。 一、动态贴纸&#xff1a;个性化互动的开始 动态贴纸&#xff0c…...

〔021〕Stable Diffusion 之 提示词反推、自动补全、中文输入 篇

✨ 目录 &#x1f388; 反推提示词 / Tagger&#x1f388; 反推提示词 Tagger 使用&#x1f388; 英文提示词自动补全 / Booru tag&#x1f388; 英文提示词自动补全 Booru tag 使用&#x1f388; 中文提示词自动补全 / tagcomplete&#x1f388; 中文提示词自动补全 tagcomple…...

如何实现响应式布局

要实现响应式布局&#xff0c;您可以采用以下方法&#xff1a; 视口设置&#xff1a; 在HTML的<head>部分中使用meta标签设置视口&#xff1a; <meta name"viewport" content"widthdevice-width, initial-scale1.0">使用百分比&#xff1a; 使…...

HTML <tr> 标签

实例 一个简单的 HTML 表格,包含两行两列: <table border="1"><tr><th>Month</th><th>Savings</th></tr><tr><td>January</td><td>$100</td></tr> </table>定义和用法 &l…...

点云从入门到精通技术详解100篇-点云多尺度分类网络

目录 前言 研究现状与发展趋势 国内外研究现状 点云处理应用研究现状...

电脑怎么设置定时关机,2个简单的操作

电脑作为现代生活中不可或缺的工具&#xff0c;我们通常会在工作或娱乐过程中使用它。但有时候&#xff0c;我们可能需要在一段时间后自动关机&#xff0c;例如在下载完成后或在睡觉前。那么电脑怎么设置定时关机呢&#xff1f;为了满足这种需求&#xff0c;电脑提供了多种定时…...

Uboot指令与烧录

目录 1 NAND Flash&#xff1a; 1&#xff09;地址空间说明 2&#xff09;烧写u-boot 3&#xff09;烧写内核 4&#xff09;烧写文件系统 5&#xff09;设置启动参数 2 SPI Flash&#xff1a; 1&#xff09;地址空间说明 2&#xff09;烧写u-boot 3&#xff09;烧写内…...

Visual Studio中使用预编译头文件

预编译头文件&#xff08;Precompiled Header&#xff0c;PCH&#xff09;是一种C/C编译优化技术&#xff0c;用于提高大型项目的编译速度。PCH 文件包含了常用的头文件的预编译结果&#xff0c;它可以在编译其他源文件之前被加载到内存中&#xff0c;从而减少了重复的头文件解…...

C语言:选择+编程(每日一练Day15)

目录 选择题&#xff1a; 题一&#xff1a; 题二&#xff1a; 题三&#xff1a; 题四&#xff1a; 题五&#xff1a; 编程题&#xff1a; 题一&#xff1a;寻找奇数 思路一&#xff1a; 题二&#xff1a;寻找峰值 思路一&#xff1a; 本人实力有限可能对一些地方解…...

确定Mac\Linux系统的架构类型是 x86-64(amd64),还是 arm64 架构

我们在下载软件或镜像时会有很多版本&#xff0c;那需要根据我们的系统架构选择正确的软件或镜像版本。 要确定你的系统使用的是 x86-64&#xff08;amd64&#xff09; 还是 arm64 架构&#xff0c;可以使用以下方法之一&#xff1a; 使用 uname 命令&#xff1a; 打开终端&am…...

深入剖析AI大模型:大模型时代的 Prompt 工程全解析

今天聊的内容&#xff0c;我认为是AI开发里面非常重要的内容。它在AI开发里无处不在&#xff0c;当你对 AI 助手说 "用李白的风格写一首关于人工智能的诗"&#xff0c;或者让翻译模型 "将这段合同翻译成商务日语" 时&#xff0c;输入的这句话就是 Prompt。…...

Unity3D中Gfx.WaitForPresent优化方案

前言 在Unity中&#xff0c;Gfx.WaitForPresent占用CPU过高通常表示主线程在等待GPU完成渲染&#xff08;即CPU被阻塞&#xff09;&#xff0c;这表明存在GPU瓶颈或垂直同步/帧率设置问题。以下是系统的优化方案&#xff1a; 对惹&#xff0c;这里有一个游戏开发交流小组&…...

如何在看板中体现优先级变化

在看板中有效体现优先级变化的关键措施包括&#xff1a;采用颜色或标签标识优先级、设置任务排序规则、使用独立的优先级列或泳道、结合自动化规则同步优先级变化、建立定期的优先级审查流程。其中&#xff0c;设置任务排序规则尤其重要&#xff0c;因为它让看板视觉上直观地体…...

质量体系的重要

质量体系是为确保产品、服务或过程质量满足规定要求&#xff0c;由相互关联的要素构成的有机整体。其核心内容可归纳为以下五个方面&#xff1a; &#x1f3db;️ 一、组织架构与职责 质量体系明确组织内各部门、岗位的职责与权限&#xff0c;形成层级清晰的管理网络&#xf…...

【C++从零实现Json-Rpc框架】第六弹 —— 服务端模块划分

一、项目背景回顾 前五弹完成了Json-Rpc协议解析、请求处理、客户端调用等基础模块搭建。 本弹重点聚焦于服务端的模块划分与架构设计&#xff0c;提升代码结构的可维护性与扩展性。 二、服务端模块设计目标 高内聚低耦合&#xff1a;各模块职责清晰&#xff0c;便于独立开发…...

九天毕昇深度学习平台 | 如何安装库?

pip install 库名 -i https://pypi.tuna.tsinghua.edu.cn/simple --user 举个例子&#xff1a; 报错 ModuleNotFoundError: No module named torch 那么我需要安装 torch pip install torch -i https://pypi.tuna.tsinghua.edu.cn/simple --user pip install 库名&#x…...

VM虚拟机网络配置(ubuntu24桥接模式):配置静态IP

编辑-虚拟网络编辑器-更改设置 选择桥接模式&#xff0c;然后找到相应的网卡&#xff08;可以查看自己本机的网络连接&#xff09; windows连接的网络点击查看属性 编辑虚拟机设置更改网络配置&#xff0c;选择刚才配置的桥接模式 静态ip设置&#xff1a; 我用的ubuntu24桌…...

redis和redission的区别

Redis 和 Redisson 是两个密切相关但又本质不同的技术&#xff0c;它们扮演着完全不同的角色&#xff1a; Redis: 内存数据库/数据结构存储 本质&#xff1a; 它是一个开源的、高性能的、基于内存的 键值存储数据库。它也可以将数据持久化到磁盘。 核心功能&#xff1a; 提供丰…...

MFE(微前端) Module Federation:Webpack.config.js文件中每个属性的含义解释

以Module Federation 插件详为例&#xff0c;Webpack.config.js它可能的配置和含义如下&#xff1a; 前言 Module Federation 的Webpack.config.js核心配置包括&#xff1a; name filename&#xff08;定义应用标识&#xff09; remotes&#xff08;引用远程模块&#xff0…...

绕过 Xcode?使用 Appuploader和主流工具实现 iOS 上架自动化

iOS 应用的发布流程一直是开发链路中最“苹果味”的环节&#xff1a;强依赖 Xcode、必须使用 macOS、各种证书和描述文件配置……对很多跨平台开发者来说&#xff0c;这一套流程并不友好。 特别是当你的项目主要在 Windows 或 Linux 下开发&#xff08;例如 Flutter、React Na…...