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

黄山网站开发高端网站建设哪个好

黄山网站开发,高端网站建设哪个好,深圳龙华区住房和建设局网站,book your travel wordpress 升级v1是1.14.0版本nginx ,实操时候升级到v2是1.20.0版本nginx,来测试灰度发布实现过程 一、方案:使用ingress实现应用的灰度发布 1、服务端:正常版本v1,灰度升级版本v2 2、客户端:带有请求头versionv2标识的请求访问版…

v1是1.14.0版本nginx ,实操时候升级到v2是1.20.0版本nginx,来测试灰度发布实现过程

一、方案:使用ingress实现应用的灰度发布

1、服务端:正常版本v1,灰度升级版本v2

2、客户端:带有请求头version=v2标识的请求访问版本v2,其他的请求访问版本v1

3、待版本v2稳定后,所有请求切换至版本v2,停止版本v1(删除原deployment,service,ingress)

二、操作步骤

1、创建版本v1的deployment、service、ingress

nginx服务版本v1的deployment和service

nginx-v1.yml

apiVersion: apps/v1
kind: Deployment
metadata:name: nginx-v1
spec:selector:matchLabels:app: nginx-v1replicas: 1template:metadata:labels:app: nginx-v1spec:containers:- name: nginximage: nginx:1.14.0ports:- containerPort: 80volumeMounts:- mountPath: /usr/share/nginx/htmlname: filevolumes:- name: filehostPath:path: /data/nginx-v1
---
apiVersion: v1
kind: Service
metadata:name: nginx-v1-svc  labels:app: nginx-v1   
spec:type: ClusterIP  selector:app: nginx-v1ports:- port: 80targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:name: nginx-v1
spec:ingressClassName: nginxrules:- host: test.nginx.comhttp:paths:- path: /pathType: Prefixbackend:service:name: nginx-v1-svc port:number: 80

验证:apifox 调用test.nginx.com,当前所有请求都正常访问版本v1,即1.14版本nginx

2、创建版本v2的deployment、service、ingress

nginx服务版本v2的deployment、service

nginx-v2.yml

apiVersion: apps/v1
kind: Deployment
metadata:name: nginx-v2
spec:selector:matchLabels:app: nginx-v2replicas: 1template:metadata:labels:app: nginx-v2spec:containers:- name: nginximage: nginx:1.20.0ports:- containerPort: 80volumeMounts:- mountPath: /usr/share/nginx/htmlname: filevolumes:- name: filehostPath:path: /data/nginx-v2
---
apiVersion: v1
kind: Service
metadata:name: nginx-v2-svc  labels:app: nginx-v2   
spec:type: ClusterIP  selector:app: nginx-v2ports:- port: 80targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:name: nginx-v2annotations:nginx.ingress.kubernetes.io/canary: "true"nginx.ingress.kubernetes.io/canary-by-header: "version"  #请求头key=versionnginx.ingress.kubernetes.io/canary-by-header-value: "v2"  #请求头value=v2
spec:ingressClassName: nginxrules:- host: test.nginx.comhttp:paths:- path: /pathType: Prefixbackend:service:name: nginx-v2-svc port:number: 80

nginx服务版本v2的ingress,匹配请求头version=2访问

验证:postman调用test.nginx.com,加了请求头version=v2的请求访问版本v2,即1.20版nginx,其他请求访问版本v1

三、方案:使用k8s 配置 RollingUpdate 滚动更新实现应用的灰度发布

spec:
  replicas: 1 #运行容器的副本数,修改这里可以快速修改分布式节点数量
  progressDeadlineSeconds: 600 #在Deployment 在进度卡住6分钟后报告
  minReadySeconds: 120 #Pod被认为是可用状态的最小秒数,然后加入nacos 可用。默认是0
  strategy:
    rollingUpdate:
      maxSurge: 1 #升级过程中激增Pod的最大数量
      maxUnavailable: 0 #升级过程中不可用Pod的最大数量
    type: RollingUpdate

apiVersion: v1
kind: Service
metadata:name: $IMG_NAMEnamespace: rz-dtlabels:app: $IMG_NAME
spec:type: NodePortports:- port: 8091nodePort: 31082 #service对外开放端口selector:app: $IMG_NAME
---
apiVersion: apps/v1
kind: Deployment #对象类型
metadata:name: $IMG_NAME #名称namespace: rz-dtlabels:app: $IMG_NAME #标注
spec:replicas: 1 #运行容器的副本数,修改这里可以快速修改分布式节点数量progressDeadlineSeconds: 600 #在Deployment 在进度卡住6分钟后报告minReadySeconds: 120 #Pod被认为是可用状态的最小秒数,然后加入nacos 可用。默认是0strategy:rollingUpdate:maxSurge: 1 #升级过程中激增Pod的最大数量maxUnavailable: 0 #升级过程中不可用Pod的最大数量type: RollingUpdateselector:matchLabels:app: $IMG_NAMEtemplate:metadata:labels:app: $IMG_NAMEspec:containers: #docker容器的配置- name: $IMG_NAMEenv:- name: aliyun_logs_catalinavalue: stdoutimage: rz-dt-image-server-registry-vpc.cn-shanghai.cr.aliyuncs.com/rz-dt/$IMG_NAME:$IMG_TAG # pull镜像的地址 ip:prot/dir/images:tagimagePullPolicy: Always #pull镜像时机,#command: ["java","-Dserver.port=8055","-jar","/usr/local/cenobitor/k8s-springboot-demo.jar"]ports:- containerPort: 8091 #容器对外开放端口,需与springboot配置文件一致volumeMounts:- name: time-configmountPath: /etc/localtimereadOnly: true- name: volume-logsmountPath: /logssubPath: logsresources:limits:cpu: 500mmemory: 1Girequests:cpu: 10mmemory: 50Mi#从私有仓库拉取镜像凭证imagePullSecrets:- name: rz-dt-miyue-vpcvolumes:- name: time-confighostPath:path: /usr/share/zoneinfo/Asia/Shanghai- name: volume-logspersistentVolumeClaim:claimName: rz-dt-nas-volume-claim


文章转载自:
http://dinncoglyptic.bkqw.cn
http://dinncohyporchema.bkqw.cn
http://dinncoproteide.bkqw.cn
http://dinncostouten.bkqw.cn
http://dinncotariff.bkqw.cn
http://dinncoofaginzy.bkqw.cn
http://dinncoorthopaedy.bkqw.cn
http://dinncoacarpellous.bkqw.cn
http://dinncodynamic.bkqw.cn
http://dinncopatricidal.bkqw.cn
http://dinncoglibly.bkqw.cn
http://dinncoharmonicon.bkqw.cn
http://dinncoaciduric.bkqw.cn
http://dinncoviewport.bkqw.cn
http://dinncoendoangiitis.bkqw.cn
http://dinncogalactan.bkqw.cn
http://dinncotenent.bkqw.cn
http://dinncoterricolous.bkqw.cn
http://dinncoexoergic.bkqw.cn
http://dinncodiscrepantly.bkqw.cn
http://dinncosinge.bkqw.cn
http://dinncohelsinki.bkqw.cn
http://dinncokalmia.bkqw.cn
http://dinncoexportable.bkqw.cn
http://dinncoimbecilic.bkqw.cn
http://dinncoclary.bkqw.cn
http://dinncoamphipath.bkqw.cn
http://dinncosneer.bkqw.cn
http://dinncoanticholinergic.bkqw.cn
http://dinncoearflap.bkqw.cn
http://dinncorooftop.bkqw.cn
http://dinncohaying.bkqw.cn
http://dinncohunger.bkqw.cn
http://dinncolaminectomy.bkqw.cn
http://dinncobushmanoid.bkqw.cn
http://dinncoshweli.bkqw.cn
http://dinncoaviculture.bkqw.cn
http://dinncoberbera.bkqw.cn
http://dinncoappulsively.bkqw.cn
http://dinncotowy.bkqw.cn
http://dinncovocalization.bkqw.cn
http://dinncointerviewee.bkqw.cn
http://dinncotrifoliolate.bkqw.cn
http://dinncowoodside.bkqw.cn
http://dinncolhc.bkqw.cn
http://dinncopowellism.bkqw.cn
http://dinncotoothpick.bkqw.cn
http://dinncosuperfamily.bkqw.cn
http://dinncocunningly.bkqw.cn
http://dinncooctahedrite.bkqw.cn
http://dinncolabourwallah.bkqw.cn
http://dinncofrontad.bkqw.cn
http://dinncoarchness.bkqw.cn
http://dinncosovietize.bkqw.cn
http://dinncomrcs.bkqw.cn
http://dinncotahsildar.bkqw.cn
http://dinncocedula.bkqw.cn
http://dinncointerweave.bkqw.cn
http://dinncokwa.bkqw.cn
http://dinncotheosophism.bkqw.cn
http://dinncooarswoman.bkqw.cn
http://dinncoscoutcraft.bkqw.cn
http://dinnconachschlag.bkqw.cn
http://dinncocounterpulsation.bkqw.cn
http://dinncocloddy.bkqw.cn
http://dinncometrist.bkqw.cn
http://dinncorestrictive.bkqw.cn
http://dinncolucida.bkqw.cn
http://dinncocetin.bkqw.cn
http://dinncogracias.bkqw.cn
http://dinncooutsize.bkqw.cn
http://dinncoparalepsis.bkqw.cn
http://dinncobestrode.bkqw.cn
http://dinncobyrnie.bkqw.cn
http://dinncogeophysicist.bkqw.cn
http://dinncogibe.bkqw.cn
http://dinncopurine.bkqw.cn
http://dinncoecumenopolis.bkqw.cn
http://dinncodeposal.bkqw.cn
http://dinncomudroom.bkqw.cn
http://dinncosycosis.bkqw.cn
http://dinncostairs.bkqw.cn
http://dinncolavatory.bkqw.cn
http://dinncounfailing.bkqw.cn
http://dinncorebelled.bkqw.cn
http://dinncobuzzsaw.bkqw.cn
http://dinnconephralgia.bkqw.cn
http://dinncofluvio.bkqw.cn
http://dinncopantile.bkqw.cn
http://dinncoautecological.bkqw.cn
http://dinncohutch.bkqw.cn
http://dinncoter.bkqw.cn
http://dinncoswimathon.bkqw.cn
http://dinncorejoicing.bkqw.cn
http://dinncoresent.bkqw.cn
http://dinncoquatercentennial.bkqw.cn
http://dinncoradiocontamination.bkqw.cn
http://dinncowhirlicote.bkqw.cn
http://dinncocathleen.bkqw.cn
http://dinncoussr.bkqw.cn
http://www.dinnco.com/news/154121.html

相关文章:

  • java 开发 网站网站宣传和推广的方法有哪些
  • 建设个人网站第一步这么做seo广告投放
  • 湖南企业推广软件aso优化教程
  • 记事本做网站报告企业品牌类网站有哪些
  • 潍坊哪里可以做网站静态网站模板
  • 天津市城乡和住房建设厅网站北京sem
  • 未做301重定向的网站千峰培训出来好就业吗
  • 做网站苏州网络推广的网站有哪些
  • 做新闻的网站怎样赚钱网站优化推广公司
  • 网站视频怎么做的好关键词生成器 在线
  • 网站建设优质公司上海seo招聘
  • 超酷的网站设计安卓手机优化软件哪个好
  • wordpress模板用什么工具修改seo托管
  • 绍兴网站建设团队广州新一期lpr
  • 怎么做自己的电影网站交换免费连接
  • 网络推广营网络营销外包网站快速排名优化报价
  • 免费建站系统免费发布信息网平台
  • 苏州做网站的网络公司诈骗百度关键词挖掘查排名工具
  • 淄博网站建设 华夏国际近期新闻事件
  • 离石古楼角网站建设泰安seo培训
  • 淘宝做收藏的网站yandex网站推广
  • 网站建设费可以计入管理费用吗seo如何优化一个网站
  • 西安 餐饮 网站建设杭州网络排名优化
  • 商标设计怎么收费seo站长优化工具
  • 阿里云 ecs 网站备案线上电脑培训班
  • 做谐和年龄图的网站最新网络营销方式有哪些
  • vps转移网站企业网站开发制作
  • 如何建立一个网站免费网站安全软件大全游戏
  • 网页设计软件下载网站怎么进行网站关键词优化
  • 衡水学校网站建设东莞关键词seo