RHCA之路---EX280(5)

news2024/12/25 9:26:36

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>':

    default
    ditto
  * farm
    kube-public
    kube-service-catalog
    kube-system
    logging
    management-infra
    openshift
    openshift-ansible-service-broker
    openshift-infra
    openshift-node
    openshift-template-service-broker
    openshift-web-console
    rome
    samples
    shrimp

Using 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: 3Gi
  accessModes:
  - ReadWriteOnce
  nfs:
    path: /exports/mysql
    server: services.lab.example.com
  persistentVolumeReclaimPolicy: Recycle

2.3.2 mypvc.yaml

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

2.3.3 pod-mysql.yaml

apiVersion: v1
kind: Pod
metadata:
  name: mysql
  labels:
    name: mysql
spec:
  containers:
    - image: registry.lab.example.com/rhscl/mysql-57-rhel7:latest
      name: mysql
      env:
        - name: MYSQL_ROOT_PASSWORD
          value: redhat
        - name: MYSQL_USER
          value: tom
        - name: MYSQL_PASSWORD
          value: redhat
        - name: MYSQL_DATABASE
          value: blog
      ports:
        - containerPort: 3306
          name: mysql
      volumeMounts:
        - name: mysql-persistent-storage
          mountPath: /var/lib/mysql/data
  volumes:
    - name: mysql-persistent-storage
      persistentVolumeClaim:
        claimName: dbclaim

2.3.4 service-mysql.yaml

apiVersion: v1
kind: Service
metadata:
  labels:
    name: mysql
  name: 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 service
  selector:
    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.7s

2023-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: 4Gi
  accessModes:
  - ReadWriteOnce
  nfs:
    path: /exports/wordpress
    server: services.lab.example.com
  persistentVolumeReclaimPolicy: Recycle

2.4.3 wppvc.yaml

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

2.4.4 pod-wordpress.yaml

apiVersion: v1
kind: Pod
metadata:
  name: wordpress
  labels:
    name: wordpress
spec:
  containers:
    - image: registry.lab.example.com/openshift/wordpress:latest
      name: wordpress
      env:
        - name: WORDPRESS_DB_USER
          value: root
        - name: WORDPRESS_DB_PASSWORD
          value: redhat
        - name: WORDPRESS_DB_NAME
          value: 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 namespace
          value: mysql
      ports:
        - containerPort: 80
          name: wordpress
      volumeMounts:
        - name: wordpress-persistent-storage
          mountPath: /var/www/html
  volumes:
    - name: wordpress-persistent-storage
      persistentVolumeClaim:
       claimName: blogclaim

2.4.5 service-wp.yaml

apiVersion: v1
kind: Service
metadata:
  labels:
    name: wpfrontend
  name: wpfrontend
spec:
  ports:
    # the port that this service should serve on
    - port: 80
      targetPort: 80
  # label keys and values that must match in order to receive traffic for this service
  selector:
    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. 确认

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

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

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

相关文章

蓝桥杯打卡Day1

文章目录 全排列八皇后 一、全排列IO链接 本题思路:本题是一道经典的全排列问题&#xff0c;深度优先搜索即可解决。 #include <bits/stdc.h>constexpr int N10;std::string s; std::string ans; int n; bool st[N];void dfs(int u) {if(un){std::cout<<ans<…

java 基础面试题 静态绑定与动态绑定

一 静态绑定与动态绑定 1.1 前言概述 昨天去用友面试&#xff0c;被问到了如下几个问题 1.单例模式使用场景 2.责任链模式 3.分布式事务TCC 4.动态绑定和静态绑定 5.类加载器 今天就来研究一下静态绑定和动态绑定 1.2 静态绑定代码 1.父类&#xff1a;定义一个stati…

OpenCV实现Photoshop曲线调整

《QT 插件化图像算法研究平台》有仿Photoshop曲线调整图像的功能&#xff0c;包括RGB曲线调整和HSV曲线调整。 Photoshop曲线调整原理&#xff1a;RGB、HSV各通道曲线&#xff0c;可以理解为一个值映射&#xff08;值转换&#xff09;函数。X轴是输入&#xff0c;Y轴是输出。x0…

什么是SpringCloud Eureka服务注册与发现

&#x1f600;前言 本篇博文是关于SpringCloud Eureka 介绍&#xff0c;希望你能够喜欢 &#x1f3e0;个人主页&#xff1a;晨犀主页 &#x1f9d1;个人简介&#xff1a;大家好&#xff0c;我是晨犀&#xff0c;希望我的文章可以帮助到大家&#xff0c;您的满意是我的动力&…

包管理工具--》npm的配置及使用(一)

目录 &#x1f31f;概念 &#x1f31f;背景 &#x1f31f;前端包管理器 &#x1f31f;包的安装 本地安装 全局安装 &#x1f31f;包配置 配置文件 保存依赖关系 &#x1f31f;包的使用 &#x1f31f;概念 模块&#xff08;module&#xff09; 通常以单个文件形式存…

解决windows下git操作提示用户名密码错误的问题

当代码从一个平台切换到另一个平台的时候&#xff0c;需要做两步操作&#xff0c;第一步就是更新git的仓库地址&#xff0c;在项目的.git/config文件里面修改&#xff0c;这一步做完之后&#xff0c;就可以推送代码到新的仓库了&#xff0c;这里就是重点来了。 一般第一次推动代…

数据结构与算法复杂度介绍

目录 一、基本概念 二、时间复杂度 【2.1】时间复杂度概念 【2.2】大O的渐进表示法 【2.3】举例时间复杂度计算 三、空间复杂度 一、基本概念 数据结构&#xff1a;相互之间存在一种或者多种特定关系的数据元素的集合。在逻辑上可以分为线性结构&#xff0c;散列结构、树…

关于 ignore

当使用 insert into xxx 时&#xff0c;可能出现因数据类型错误插入失败的情况&#xff0c;如图所示&#xff1a; 当出现这种情况时&#xff0c;可以通过 ignore 来“强制”插入&#xff0c;提示插入成功 但是这种操作会带来隐患如图&#xff1a; 时间有问题&#xff0c;但是时…

SMU200A/罗德与施瓦茨SMU200A信号发生器

181/2461/8938产品概述 R&S SMU200A信号发生器旨在满足现代通信系统研发及其生产中遇到的所有要求。R&S SMU200A矢量信号发生器不仅将多达两个独立的信号发生器组合在一个只有四个高度单位的机柜中&#xff0c;还提供无与伦比的RF和基带特性。 Rohde & Schwarz S…

如何让Android平台像网络摄像机一样实现GB28181前端设备接入?

技术背景 好多开发者在做国标对接的时候&#xff0c;首先想到的是IPC&#xff08;网络摄像头&#xff09;&#xff0c;通过参数化配置&#xff0c;接入到国标平台&#xff0c;实现媒体数据的按需查看等操作。 像执法记录仪等智能终端&#xff0c;跑在Android平台&#xff0c;…

mysql主从同步步骤(一主一从)

1、主库添加binlog配置&#xff0c;并设置server-id server-id124 # 设置日志格式,日志路径(注意路经需要mysql用户有权限写&#xff0c;默认地址放在datadir的目录下) binlog_formatmixed log-binmysql-bin# 设置binlog清理时间(秒), binlog每个日志文件大小 binlog_expire_l…

线上问诊:数仓开发(三)

系列文章目录 线上问诊&#xff1a;业务数据采集 线上问诊&#xff1a;数仓数据同步 线上问诊&#xff1a;数仓开发(一) 线上问诊&#xff1a;数仓开发(二) 线上问诊&#xff1a;数仓开发(三) 文章目录 系列文章目录前言一、ADS1.交易主题1.交易综合统计2.各医院交易统计3.各性…

行业追踪,2023-09-04

自动复盘 2023-09-04 凡所有相&#xff0c;皆是虚妄。若见诸相非相&#xff0c;即见如来。 k 线图是最好的老师&#xff0c;每天持续发布板块的rps排名&#xff0c;追踪板块&#xff0c;板块来开仓&#xff0c;板块去清仓&#xff0c;丢弃自以为是的想法&#xff0c;板块去留让…

实时操作系统Freertos开坑学习笔记:(四):临界段保护、列表与列表项

前言 废话不多说&#xff0c;直接看主要要探究的问题&#xff1a; 一、临界段代码保护 1.什么是临界段&#xff1f; 图里面说&#xff0c;临界区的代码是不能被打断的&#xff0c;它运行时不能被中断打断&#xff0c;也不能由于非阻塞任务延时而切换到其他任务去。 比如说…

【Java转Go】Go中使用WebSocket实现聊天室(私聊+群聊)

目录 前言功能效果&#xff08;一人分饰多角.jpg&#x1f60e;&#xff09;用户上线、群聊私聊和留言下线 实现思路代码服务端 chat.go 完整代码客户端 html 完整代码 最后 前言 之前在Java中&#xff0c;用 springbootwebsocket 实现了一个聊天室&#xff1a;springbootwebso…

用BAPI创建销售订单条件价格有多个

说明&#xff1a; 在用BAPI_SALESORDER_CREATEFROMDAT2创建销售订单的时候&#xff0c;业务配置的是Z001自动出来的&#xff0c;我在BAPI条件那块赋值更改标识也是U&#xff0c;但是创建出来的单据还是有两条件类型。 解决方法&#xff1a; LOGIC_SWITCH-PRICING G .即可

AP9193 升压恒流驱动芯片 美容护肤仪 美容灯 锂电池升压驱动IC

AP9193 是一款高效率、高精度的升 压型大功率 LED 灯恒流驱动控制芯片。 应用领域 LED 灯杯 电池供电的 LED 灯串 平板显示 LED 背光 恒流充电器控制 大功率 LED 照明 AP9193 内置高精度误差放大器&#xff0c;固 定关断时间控制电路&#xff0c;恒流驱动电路等&#xff…

签到系统怎么设计

背景 相信签到系统大家都有接触过&#xff0c;更多的是使用。但是有思考过这种系统是怎么设计的吗&#xff1f;比方说我统计一下每个月中每天的签到情况&#xff0c;怎么设计呢&#xff1f;今天一篇文章告诉你。 首先&#xff0c;我们熟悉的思维是&#xff1a;我设计一个数据…

电商平台-业务中台-SPU,SKU,SN概念简介

什么是SPU &#xff08;Standard Product Unit)? SPU标准属性是商品基本属性&#xff0c;基本属性中最核心两个属性是品牌和型号&#xff0c;电商平台一般采用 品牌和型号 来确定SPU&#xff08;Standard Product Unit&#xff09;标准化管理单元&#xff0c; 例如:小米 10 就…

Vue3 el-tooltip 根据内容控制宽度大小换行和并且内容太短不显示

el-tooltip 根据长度自适应换行以及显隐 环境 vue: "3.2.37" element-ui: "2.1.8"要求 tooltip 根据内容自动换行如果内容超出显示省略号显示&#xff0c;不超出不显示 tooltip 代码 组件 // ContentTip 组件 <template><el-tooltipv-bind&qu…