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

网站开发的费用嘉兴网站建设品牌升级

网站开发的费用,嘉兴网站建设品牌升级,外贸网站推广平台有哪些,广州网站建设公司兴田德润怎么样概述 在Kubernetes的世界中,Pod作为最基本的应用进程单元, 其生命周期也代表着应用进程的整个生命周期。了解其生命周期是掌握云计算中一个计算单元如何在Kubernetes世界周转的基石。 本期文章主要针对于Pod的生命周期的不同阶段进行介绍,让读者能够对…

概述

在Kubernetes的世界中,Pod作为最基本的应用进程单元, 其生命周期也代表着应用进程的整个生命周期。了解其生命周期是掌握云计算中一个计算单元如何在Kubernetes世界周转的基石。

本期文章主要针对于Pod的生命周期的不同阶段进行介绍,让读者能够对Pod 从创建Pending到运行Running,然后到如何优雅的退出Terminating等整个周期有个框架性的了解,从而在实际工作中遇到问题和难题的时候能够更快定位并解决。

Pod Lifecycle

Kubernetes官方网站将Pod 的生命周期通过PodStatus 分为以下五种:

PendingThe Pod has been accepted by the Kubernetes cluster, but one or more of the containers has not been set up and made ready to run. This includes time a Pod spends waiting to be scheduled as well as the time spent downloading container images over the network.
RunningThe Pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting.
SucceededAll containers in the Pod have terminated in success, and will not be restarted.
FailedAll containers in the Pod have terminated, and at least one container has terminated in failure. That is, the container either exited with non-zero status or was terminated by the system, and is not set for automatic restarting.
UnknownFor some reason the state of the Pod could not be obtained. This phase typically occurs due to an error in communicating with the node where the Pod should be running.

Pending

当Pod 通过各种Controller(比如Deployment, StatefulSet, DaemonSet等)创建后,Kubernetes Scheduler 接受Pod的创建,在真正Pod 运行起来Running 之前,需要等待某些条件完成后才能进入运行起来,这些条件包括:

  1. 集群中有足够多的内存和CPU来运行该Pod
  2. Pod中定义的Container Image拉取完毕
  3. ...

当且仅当所以运行的条件都满足之后,Pod 才由Pending 变为Running. 

Running

Running代表着Pod 正常运行的过程,其中Running 说明Pod是时时刻刻可以介绍外来请求并相应的。但是如果一个Pod中进程挂了,Kubernetes 如果更新并了解Pod的内部运行程序的最新情况呢?这个就需要最Pod上配置readinessProbe 和livenessProbe 了。通过这两个配置让你告诉kubernetes的kubelet 如何实时监控并定义你的Pod中容器的运行情况。

livenessProbe 和readinessProbe的官方定义如下:

livenessProbe

Indicates whether the container is running. If the liveness probe fails, the kubelet kills the container, and the container is subjected to its restart policy. If a container does not provide a liveness probe, the default state is Success.

只有livenessProbe 通过,kubelet才认为该container是“活着的”,否则将直接重启container。

readinessProbe

Indicates whether the container is ready to respond to requests. If the readiness probe fails, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match the Pod. The default state of readiness before the initial delay is Failure. If a container does not provide a readiness probe, the default state is Success.

readinessProbe是让kubelet认为你的容器是“ready for服务”的,这个跟你的业务是绑定的。

比如你的Pod里面跑的是一个Nginx 的服务器,你想要跑一个www.abcde.com网站,然后返回“ok”.只有这样才算是真正的“ready for服务”。

status:conditions:- type: Ready                              # a built in PodConditionstatus: "False"lastProbeTime: nulllastTransitionTime: 2018-01-01T00:00:00Z

如果readinessProbe返回False,那么对应的与网络相关的比如Service等组件会自动将该Pod 摘除下来,并将该Pod 置为“Unavailable”等并做出对应的行为。

其他类似的组件或者自定义的Controller也可以Pod.Status.Condition中的Ready项中的True or False 为基准做出对应的判断。

Succeeded Failed Unknown

这三种状态都代表Pod的非运行状态。

  • Succeeded 表示Container中的进程运行结束并return 0;
  • Failed 表示至少有一个Container 返回非0;
  • 而其它位置的状态的过程都可以归结为Unknown的状态。

当一个Pod是一个长期运行并接受请求并相应的服务时。这三个状态的Pod都不是想要的状态,Running才是其正常大部分时间需要的。

Terminating

当用户通过kubectl 或者kube-client对某个pod 发出delete的请求的时候,Pod就会触发并进入Terminating状态。直到Pod 被彻底删除并消失。

该状态中的Pod会根据用户的配置进入优雅退出(GracefulTermination)的流程。关于该流程会专门整理一篇文章来介绍。

总结

Pod作为最基本的应用进程单元, 其生命周期也代表着应用进程的整个生命周期。根据Pod状态来得知容器进程处于不同的阶段,是最快感知Kubernetes进程的方式。

本文是概述各个状态的基本介绍,大家感兴趣的话,会对其中细节一一展开介绍。有什么问题和意见欢迎留言指正。谢谢


文章转载自:

http://6eJ6O56Q.Ldgfb.cn
http://V52BNiX5.Ldgfb.cn
http://OqtPyuSL.Ldgfb.cn
http://IRNUf6YY.Ldgfb.cn
http://tFTLWYsl.Ldgfb.cn
http://1to9mXAS.Ldgfb.cn
http://MjaMfPOu.Ldgfb.cn
http://kBE0f9HW.Ldgfb.cn
http://FrzpvaCm.Ldgfb.cn
http://MMAJRvFM.Ldgfb.cn
http://Mbt6gcJK.Ldgfb.cn
http://W8yDHR8T.Ldgfb.cn
http://a9yNcrYu.Ldgfb.cn
http://XPHXZZU4.Ldgfb.cn
http://LDKiSdZp.Ldgfb.cn
http://81UCb32A.Ldgfb.cn
http://7umWTFD3.Ldgfb.cn
http://gK5XHz8S.Ldgfb.cn
http://jZUWhgy2.Ldgfb.cn
http://FcgOiHdH.Ldgfb.cn
http://Lsv9sbv9.Ldgfb.cn
http://iRTP1Cgc.Ldgfb.cn
http://PtxXvl4o.Ldgfb.cn
http://Him4U6lJ.Ldgfb.cn
http://WYb4Kz16.Ldgfb.cn
http://syFvCv0T.Ldgfb.cn
http://0KIJUjlS.Ldgfb.cn
http://Z2xAc4ok.Ldgfb.cn
http://1Ye92u0J.Ldgfb.cn
http://pCDqkxq6.Ldgfb.cn
http://www.dtcms.com/wzjs/665524.html

相关文章:

  • 百度seo怎么做网站内容优化手机淘宝网页
  • 全球搜索引擎排名2021如何提高seo关键词排名
  • 制作网页的步骤800字常州网站排名优化
  • html建站济宁建筑人才网
  • 深圳财务小公司网站做网站都可以做什么
  • 网站建设叁金手指花总9广州商城网站建设
  • 电商类网站建设价格百度seo建议
  • 潍坊住房和城乡建设局招标网站宣传片制作模板
  • 网站基础内容开一个小程序要多少钱
  • 延边网站开发depawo网站建设app是什么
  • 汕头模板自助建站珠海网站制作哪家好
  • 网站建设众包平台网站分站代理加盟
  • 如何做好网站seo商机创业网2021创业
  • 网站制作合同模板网页美工设计的要点分别是什么
  • 外链购买交易平台新网站如何做seo推广
  • 扬中企业网站优化哪家好北京做seo的公司
  • 网页跳转到其它网站onedrive wordpress
  • 石家庄网站建设方案优化seo优化包括哪些
  • 辉县网站建设求职简历网页游戏开服表最全
  • 做软装找图片的网站农副产品网站建设目标
  • 网站备案管理系统登录不上去犀牛云做网站怎么这么贵
  • 网络公司手机网站模板五金表带厂东莞网站建设
  • tp5 商城网站开发海外网站平台
  • 建设网站用哪种语言2008 iis 添加网站
  • 高埗做网站网站优化是在哪里做修改
  • 网站后台管理 ftp青海省建设监理协会网站
  • 2015年做啥网站致富网站设计需要什么专业
  • 写作网站哪个比较赚钱做任务的网站
  • 网站怎么做效果更好试述网站建设的步骤过程
  • 自己做视频网站流量钱网站服务器哪家好些