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

育儿网网站开发简述网站开发技术

育儿网网站开发,简述网站开发技术,深圳建网站 (报价),网站排名必做阶段性seo策略K8S之常见部署方案 一、普通部署二、滚动更新#xff08;Rolling update#xff09;三、蓝绿部署#xff08;Blue/Green Deployment#xff09;四、灰度发布#xff08;金丝雀发布#xff09; 常见的部署方案参考博文#xff1a;常见部署方案#xff1a;普通部署、滚动… K8S之常见部署方案 一、普通部署二、滚动更新Rolling update三、蓝绿部署Blue/Green Deployment四、灰度发布金丝雀发布 常见的部署方案参考博文常见部署方案普通部署、滚动部署、蓝绿部署、灰度发布金丝雀发布 一、普通部署 特点 先停止旧的pod然后再创建新的pod这个过程服务是会间断的。 创建recreate.yaml apiVersion: apps/v1 kind: Deployment metadata:name: recreate spec:strategy:type: Recreateselector:matchLabels:app: recreatereplicas: 4template:metadata:labels:app: recreatespec:containers:- name: recreateimage: registry.cn-hangzhou.aliyuncs.com/itcrazy2016/test-docker-image:v1.0ports:- containerPort: 8080livenessProbe:tcpSocket:port: 8080命令 kubectl apply -f recreate.yaml kubectl get pods修改recreate.yaml文件 kubectl apply -f recreate.yaml kubectl get podsconclusion 发现pod是先停止然后再创建新的。 NAME READY STATUS RESTARTS AGE recreate-655d4868d8-5dqcz 0/1 Terminating 0 2m31s recreate-655d4868d8-sb688 0/1 Terminating 0 2m31s测试 kubectl rollout pause deploy rollingupdate kubectl rollout resume deploy rollingupdate kubectl rollout undo deploy rollingupdate # 回到上一个版本二、滚动更新Rolling update 服务不会停止但是整个pod会有新旧并存的情况。 创建rollingupdate.yaml maxSurge 滚动升级时先启动的pod数量 maxUnavailable 滚动升级时允许的最大unavailable的pod数量 apiVersion: apps/v1 kind: Deployment metadata:name: rollingupdate spec:strategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdateselector:matchLabels:app: rollingupdatereplicas: 4template:metadata:labels:app: rollingupdatespec:containers:- name: rollingupdateimage: registry.cn-hangzhou.aliyuncs.com/itcrazy2016/test-docker-image:v1.0ports:- containerPort: 8080 --- apiVersion: v1 kind: Service metadata:name: rollingupdate spec:ports:- port: 80protocol: TCPtargetPort: 8080selector:app: rollingupdatetype: ClusterIP命令 kubectl apply -f rollingupdate.yaml kubectl get pods kubectl get svc curl cluster-ip/dockerfile修改rollingupdate.yaml文件将镜像修改成v2.0 # 在w1上不断地访问观察输出 while sleep 0.2;do curl cluster-ip/dockerfile;echo ;done # 在w2上监控pod kubectl get pods -w # 使得更改生效 kubectl apply -f rollingupdate.yaml kubectl get podsconclusion 发现新旧pod是会共存的并且可以访问测试看一下 kubectl get pods -w kubectl get svc可以发现新老版本的确会共存。 三、蓝绿部署Blue/Green Deployment 无需停机风险较小 1部署v1的应用一开始的状态 所有外部请求的流量都打到这个版本上2部署版本2的应用 版本2的代码与版本1不同(新功能、Bug修复等).3将流量从版本1切换到版本2。4如版本2测试正常就删除版本1正在使用的资源例如实例从此正式用版本2 创建bluegreen.yaml #deploy apiVersion: apps/v1 kind: Deployment metadata:name: blue spec:strategy:rollingUpdate:maxSurge: 25%maxUnavailable: 25%type: RollingUpdateselector:matchLabels:app: bluegreenreplicas: 4template:metadata:labels:app: bluegreenversion: v1.0spec:containers:- name: bluegreenimage: registry.cn-hangzhou.aliyuncs.com/itcrazy2016/test-docker-image:v1.0ports:- containerPort: 8080命令 kubectl apply -f bluegreen.yaml kubectl get pods创建bluegreen-service.yaml apiVersion: v1 kind: Service metadata:name: bluegreen spec:ports:- port: 80protocol: TCPtargetPort: 8080selector:app: bluegreenversion: v1.0type: ClusterIP命令 kubectl apply -f bluegreen-service.yaml kubectl get svc # 在w1上不断访问观察 while sleep 0.3;do curl cluster-ip/dockerfile;echo ;done修改bluegreen.yaml 01-deployment-name:blue — green 02-image:v1.0— v2.0 03-version:v1.0 — v2.0 kubectl apply -f bluegreen.yaml kubectl get pods # 同时观察刚才访问的地址有没有变化 # 可以发现两个版本就共存了并且之前访问的地址没有变化修改bluegreen-service.yaml # 也就是把流量切到2.0的版本中 selector:app: bluegreenversion: v2.0kubectl apply -f bluegreen-service.yaml kubectl get svc # 同时观察刚才访问的地址有没有变化 # 发现流量已经完全切到了v2.0的版本上四、灰度发布金丝雀发布 修改bluegreen-service.yaml selector: app: bluegreen version: v2.0 # 把version删除掉只是根据bluegreen进行选择修改后 apiVersion: v1 kind: Service metadata:name: bluegreen spec:ports:- port: 80protocol: TCPtargetPort: 8080selector:app: bluegreen#version: v1.0type: ClusterIP命令 kubectl apply -f bluegreen-service.yaml同时观察刚才访问的地址有没有变化发现此时新旧版本能够同时被访问到。
http://www.hkea.cn/news/14395493/

相关文章:

  • 三网合一网站模板山西响应式网页建设哪家有
  • 怎样自己做刷赞网站五金企业网站模板
  • 建网站做代理ip长沙网站开发 58
  • 整站seo包年费用住房和城乡建设局网站职能
  • 沧州网站设计师招聘公司网站建设 费用入账
  • 祥云平台英文网站网站建设与维护 书
  • 筑站网络推广中国石化工程建设有限公司首页
  • 有什么网站建设类岗位三合一网站指的是什么
  • 国外做网站公司能赚钱吗wordpress菜单导入导出
  • 网络科技公司网站网站综合开发怎么做
  • seo技术外包 乐云践新专家seo推广引擎优化
  • 网站logo下载购票网站模板
  • 网站开发人员晋升体系wordpress html5 主题
  • 江西建设信息港网站wordpress模板制作视频
  • 公司网站建设案例怎么建设自己的一个服务器网站
  • 怎么做一个自己网站wordpress 编辑器增强
  • 天津企业网站建站深圳公司做网站
  • 网站建设的相关资料网页设计旅游网站前言
  • wordpress-5.6.20长沙抖音seo公司地址
  • 南头专业外贸网站建设公司深圳培训手机网站建设
  • 聊城网站建设品牌如何制作网站设计
  • 如何看出网站是用wordpress搭建官方网站开发模板
  • 重庆渝北做网站哪里便宜网站改版汇报
  • 洛卡博网站谁做的wordpress表白墙模板下载
  • 明年做那些网站致富百度收录提交申请网站
  • asp网站管理系统破解版惠州市网站建设个人
  • 做服装哪个网站图片多wordpress 分类页面打开400
  • 深圳建设网官方网站南宁建设网站制作
  • 上海建设检测网上登记网站软文发布平台哪家好
  • 上海网站开发月薪多少钱上海网站建设制作