当前位置:网站首页>【云原生】4.1 DevOps基础与实战
【云原生】4.1 DevOps基础与实战
2022-07-26 02:04:00 【程序猿追】
哈喽~大家好呀,在前面的一篇扩展篇里面简单的介绍了下 DevOps ,从这篇开始就进入到了自动化部署项目了。在前面我们写到的一些项目,它们都是手动一步一步添加上去的,未免显得太笨重了,如何我们有 1000 个项目,那这可不能手动部署
(这会累 si 人的),所以官方为了效率,推出了 DevOps。
个人主页:个人主页
系列专栏:【云原生系列】
与这篇相关的文章:
【云原生】3.4 RuoYi-Cloud部署实战(上) 【云原生】3.4 RuoYi-Cloud部署实战(上)_程序猿追的博客-CSDN博客 【云原生】3.5 RuoYi-Cloud部署实战(下) 【云原生】3.5 RuoYi-Cloud部署实战(下)_程序猿追的博客-CSDN博客 云原生讲解【扩展篇】 云原生讲解【扩展篇】_程序猿追的博客-CSDN博客
目录
一、DevOps简介
DevOps 是一系列做法和工具,可以使 IT 和软件开发团队之间的流程实现自动化。其中,随着敏捷软件开发日趋流行,持续集成 (CI) 和持续交付 (CD) 已经成为该领域一个理想的解决方案。在 CI/CD 工作流中,每次集成都通过自动化构建来验证,包括编码、发布和测试,从而帮助开发者提前发现集成错误,团队也可以快速、安全、可靠地将内部软件交付到生产环境。
二、尚医通项目上云
这里有服务端、客户端、以及网关;服务端与客户端部署完之后,发送请求给网关,网关把各个请求给微服务
项目架构
yygh-parent
|---common //通用模块
|---hospital-manage //医院后台 [9999]
|---model //数据模型
|---server-gateway //网关 [80]
|---service //微服务层
|-------service-cmn //公共服务 [8202]
|-------service-hosp //医院数据服务 [8201]
|-------service-order //预约下单服务 [8206]
|-------service-oss //对象存储服务 [8205]
|-------service-sms //短信服务 [8204]
|-------service-statistics //统计服务 [8208]
|-------service-task //定时服务 [8207]
|-------service-user //会员服务 [8203]
====================================================================
yygh-admin //医院管理后台 [9528]
yygh-site //挂号平台 [3000]三、sentinel 部署
上云之前呢首先要部署好中间件,像 Nacos、MySQL、Redis是之前已经部署好了的,所以接下来部署剩下的部分。
1、Sentinel
它是用来做流量保护功能的
在应用负载——>服务里面创建一个服务(设置好基本信息、容器镜像、挂载存储、高级设置等设置)

四、mongo部署
同样的,在应用负载——>应用里面选择好创建模板,点击部署(设置好基本信息、应用配置
等设置),为了侯浩方便的访问,可以将端口号暴露出去。

然后指定工作负载创建服务(设置基本信息、服务设置、高级设置),部署好了之后我们可以用个工具来测试一下是否部署完成(MongoDB Compass 的软件),连接一下,发现没问题
mysq|数据初始化
使用工具(SQLyog)连接上 mysql ,将我们要使用的 sql 语句导入进去并运行。
五、生产环境配置抽取
项目默认规则
- 每个微服务项目,在生产环境时,会自动获取
微服务名-prod.yml作为自己的核心配置文件 - 每个微服务项目,在生产环境时,默认都是使用
8080端口
创建一个 service-cmntprod.yml 将所有的中间件的地址改为我们的生产的地址,同样的每一个微服务(Sentinel、MongoDB、RabbitMQ、Redis等)都要进行这样的操作,后面配置好 deploy.yaml 文件
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: service-cart
name: service-cart
namespace: his #一定要写名称空间
spec:
progressDeadlineSeconds: 600
replicas: 1
selector:
matchLabels:
app: service-cart
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
app: service-cart
spec:
imagePullSecrets:
- name: aliyun-docker-hub #提前在项目下配置访问阿里云的账号密码
containers:
- image: $REGISTRY/$ALIYUNHUB_NAMESPACE/service-cart
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
timeoutSeconds: 10
failureThreshold: 30
periodSeconds: 5
imagePullPolicy: Always
name: app
ports:
- containerPort: 8080
protocol: TCP
resources:
limits:
cpu: 300m
memory: 600Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
labels:
app: service-cart
name: service-cart
namespace: his
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: service-cart
sessionAffinity: None
type: ClusterIP不积跬步无以至千里,趁年轻,使劲拼,给未来的自己一个交代!向着明天更好的自己前进吧!
边栏推荐
- Kaggle registration method to solve the problem of man-machine verification
- I.MX6UL核心模块使用连载-eMMC读写测试 (四)
- Are you still using ==0 null equal to judge null values? How much do you know about isempty and isblank
- win下搭建嵌入式开发环境及frp穿透
- I.MX6UL核心模块使用连载-触摸屏校准 (九)
- [leetcode] 32. Longest valid bracket
- BGP知识点总结
- Phoenix中常用shell操作
- Why does the debugger display the wrong function
- 【2021】【论文笔记】6G技术愿景——OTFS调制技术
猜你喜欢

Navica tool imports remote MySQL into local MySQL database

Worthington papain - production of glycopeptides from purified proteoglycans (attached Literature)

National standard gb28181 protocol video platform easygbs message pop-up mode optimization

C# 迭代器的实现

MySQL transaction isolation level

Worthington木瓜蛋白酶丨从纯化的蛋白聚糖生产糖肽(附文献)

I.MX6UL核心模块使用连载-Iot-6ULX核心模块简要介绍 (一)

(CVPR 2019) GSPN: Generative Shape Proposal Network for 3D Instance Segmentation in Point Cloud
![[2021] [paper notes] 6G technology vision - otfs modulation technology](/img/50/577ad05bc16e80d1c68eec7b6da988.png)
[2021] [paper notes] 6G technology vision - otfs modulation technology

What is the difference between for... In... And for... Of
随机推荐
Proto conversion dart | project uses protobuf | fluent uses grpc
1. Mx6ul core module use serial -rs485 test (x)
Create a future and enjoy extraordinary | gbase Nantah General Motors unveiled opengauss Developer Day 2022
1. Mx6ul core module use serial RTC test (XII)
[2021] [paper notes] biological effects of cell membrane under infrared and THz - effect is a phenomenon, action is a mechanism - the benefits of THz to medicine
Error reporting caused by local warehouse
[leetcode] 32. Longest valid bracket
登堂入室soc之arm汇编基础
Phoenix中常用shell操作
3. Upload the avatar to qiniu cloud and display it
Composition API的优势
Why does the debugger display the wrong function
[C language brush leetcode] 146. LRU cache (m)
Make and makefile summary I
Web3.0 blog DAPP development practice [2022]
Implementation of Ti am335x industrial control module network and file system nfs
E. OpenStreetMap (2D monotone queue)
阿里云Redis开发规范
Protect syslog servers and devices
Infinite fraction path (BFS pruning)


