Kubernetes relies on Probes to determine the health of a Pod container. A Probe is a diagnostic performed periodically by the kubelet on a container.

docs

There are two types of Probes:

1. Livenss Probe

Liveness probes can be used to determine if a Pod is healthy and running as expected

2. Readiness Probe

Readiness probes can be used to determine if a Pod should receive requests

Failed Pod containers are recreated by default (restartPolicy defaults to Always).

What is the way to check Pod health?

ExecAction: Excutes an action inside the container

TSPSockerAction: TCP check against the container's IP address on specified port

HTTPGetAction: HTTP GET request against container

Probes can have the following results:

- Success

- Failure

- Unknown

or

pods/probe/exec-liveness.yaml 

apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
containers:
- name: liveness
image: k8s.gcr.io/busybox
args:
- /bin/sh
- -c
- touch /tmp/healthy; sleep ; rm -rf /tmp/healthy; sleep
livenessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds:
periodSeconds:

--

最新文章

  1. 前端构建 build 技术 nodejs gulp
  2. angular中ng-model,返回数据,拆分数据,展示,名称相同,重新赋值会有冲突
  3. 函数柯理化以及利用柯理化实现bind方法
  4. Python 之匿名函数和偏函数
  5. centos7精简版(minimal)killall: command not found
  6. 修剪花卉(codevs 1794)
  7. Java 编译错误:缺少返回语句
  8. (转载)LINUX UNBUNTU10.04 下 搭建OC编译环境
  9. Mysql数据库文件、表、记录的增删改查
  10. Spring ——依赖注入配置一些知识点
  11. Python异步处理
  12. Learning part-based templates from large collections of 3D shapse CorrsTmplt Kim 代码调试
  13. Netty实现高性能IOT服务器(Groza)之精尽代码篇中
  14. pycharm汉化 (ubuntu版)
  15. Hbase 学习(六) 配置文件调优
  16. L-BFGS
  17. [Openwrt 项目开发笔记]:USB挂载& U盘启动(三)
  18. Dubbo学习笔记3:Dubbo管理控制台与监控中心的搭建
  19. OpenCV学习(32) 求轮廓的包围盒
  20. Spark累加器

热门文章

  1. springmvc数据的封装
  2. pt-archiver 归档历史数据及参数详解
  3. 基于OpenCV制作道路车辆计数应用程序
  4. xorm实例-创建xorm,映射
  5. 小程序day1-day3随笔
  6. showModalDialog的使用方法
  7. HTML Marquee跑马灯
  8. 虹软人脸识别SDK在网络摄像头中的实际应用
  9. Android笔记(三十七) 如何停止AsyncTask?
  10. django后台xadmin如下配置(小结)