涨薪技术|Kubernetes(k8s)之Pod生命周期(上)

我们一般将pod对象从创建至终这段时间范围成为pod的生命周期,它主要包含以下的过程:

  • pod创建过程

  • 运行初始化容器(init container)过程

  • 运行主容器(main container)

---->容器启动后钩子(post start)、容器终止前钩子(pre stop)

---->容器的存活性检测(liveness probe)、就绪性检测(readiness probe)

  • pod终止过程

图片

01Pod相位

首先在介绍 Pod 的生命周期之前,我们先了解下 Pod 的状态,因为 Pod 状态可以反映出当前我们的Pod 的具体状态信息,也是我们分析排错的一个必备的方式。

我们可以通过命令kubectl explain pod.status查看到

[root@master ~]# kubectl explain pod.statusKIND: PodVERSION: v1.....phase <string>The phase of a Pod is a simple, high-level summary of where the Pod is inits lifecycle. The conditions array, the reason and message fields, and theindividual container status arrays contain more detail about the pod'sstatus. There are five possible phase values:Pending: The pod has been accepted by the Kubernetes system, but one ormore of the container images has not been created. This includes timebefore being scheduled as well as time spent downloading images over thenetwork, which could take a while. Running: The pod has been bound to anode, and all of the containers have been created. At least one containeris still running, or is in the process of starting or restarting
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

川石课堂软件测试

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值