尚医通项目上云

1、项目架构

在这里插入图片描述

在这里插入图片描述
项目地址
https://gitee.com/leifengyang/yygh-parent
https://gitee.com/leifengyang/yygh-admin
https://gitee.com/leifengyang/yygh-site

2、中间件

中间件集群内地址外部访问地址
Nacoshis-nacos.his:8848http://139.198.165.238:30349/nacos
MySQLhis-mysql.his:3306139.198.165.238:31840
Redishis-redis.his:6379139.198.165.238:31840
Sentinelhis-sentinel.his:8858139.198.165.238:31840
MongoDBhismongodb.his:27017139.198.165.238:31840
RabbitMQhis-rabbitm-rabbitmq.his:5672139.198.165.238:31840
ElasticSearchhis-es.his:9200139.198.165.238:31840

3、生产与开发配置隔离

在这里插入图片描述

4、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

4、devops实战

第一步:拉取代码

在这里插入图片描述

第二部,项目编译

1、修改maven让他从阿里云下载镜像
● 使用admin登陆ks
● 进入集群管理
● 进入配置中心
● 找到配置
○ ks-devops-agent
○ 修改这个配置。加入maven阿里云镜像加速地址
在这里插入图片描述
shell:script mvn clean package -Dmavernetest.skip=true
在这里插入图片描述
2、缓存机制
已经下载过的jar包,下一次流水线的启动,不会重复下载

第三步,构建镜像

在这里插入图片描述

并行构建镜像

在这里插入图片描述

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值