当前位置:网站首页>[teacher Zhao Yuqiang] kubernetes' probe
[teacher Zhao Yuqiang] kubernetes' probe
2022-07-03 05:46:00 【Teacher zhaoyuqiang】

Kubernetes Probes are provided (Probe) Check the health of the container . In fact, we don't just need to do health testing on containers , Also, health testing should be carried out for the application arranged in the container .
Probe There are two types :
- livenessProbe: Survival probe , If the check fails , Will kill the container , according to Pod Of restartPolicy Restart policy operations .
- readinessProbe: Ready probe , If the check fails ,Kubernetes Will be able to Pod from service endpoints Middle elimination .
Probe The following three inspection methods are supported :
- httpGet: send out HTTP request , return 200-400 Range status code is success .
- exec: perform Shell The command return status code is 0 For success .
- tcpSocket: launch TCP Socket Build success .
Let's show the configuration of each checking method :
- exec Check
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
containers:
- name: liveness
image: busybox
args:
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
livenessProbe: ## livenessProbe Check the type
exec: ##exec Check the method
command:
- cat
- /tmp/healthy
initialDelaySeconds: 5 ## Container start up 5 I don't want to check until a few seconds later
periodSeconds: 5 ## every other 5 Check every second
- httpGet Check
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-http
spec:
containers:
- name: liveness
image: k8s.gcr.io/liveness
args:
- /server
livenessProbe: ## livenessProbe type
httpGet: ## httpGet Check the method
path: /healthz
port: 8080
httpHeaders:
- name: Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
- tcpSocket Check
apiVersion: v1
kind: Pod
metadata:
name: goproxy
labels:
app: goproxy
spec:
containers:
- name: goproxy
image: k8s.gcr.io/goproxy:0.1
ports:
- containerPort: 8080
readinessProbe: ##readinessProbe Check the type
tcpSocket: ##tcpSocket Check the method
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe: ##livenessProbe Check the type
tcpSocket: ##tcpSocket Check the method
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
边栏推荐
- How to set up altaro offsite server for replication
- Latest version of source insight
- How to use source insight
- [advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation
- 3dslam with 16 line lidar and octomap
- Get and monitor remote server logs
- [untitled]
- 配置xml文件的dtd
- 2022.DAY592
- 中职网络子网划分例题解析
猜你喜欢

Brief introduction of realsense d435i imaging principle
![[written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis](/img/c6/8847218fa43c87e3eb51c021961eb7.jpg)
[written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis

Introduction to redis using Lua script

Understand one-way hash function
![[teacher Zhao Yuqiang] MySQL high availability architecture: MHA](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[teacher Zhao Yuqiang] MySQL high availability architecture: MHA
![[trivia of two-dimensional array application] | [simple version] [detailed steps + code]](/img/84/98c1220d0f7bc3a948125ead6ff3d9.jpg)
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]

"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
![[together Shangshui Shuo series] day 7 content +day8](/img/fc/74b12addde3a4d3480e98f8578a969.png)
[together Shangshui Shuo series] day 7 content +day8

How does win7 solve the problem that telnet is not an internal or external command

Altaro o365 total backup subscription plan
随机推荐
kubernetes资源对象介绍及常用命令(五)-(ConfigMap)
Altaro o365 total backup subscription plan
Complete set of C language file operation functions (super detailed)
Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
Using the ethtool command by example
Map的扩容机制
Xaml gradient issue in uwp for some devices
Basic introduction of redis and explanation of eight types and transactions
Introduction to redis using Lua script
2022.7.2day594
mysql启动报错:The server quit without updating PID file几种解决办法
2022.6.30DAY591
Pytorch through load_ state_ Dict load weight
求质数的方法
Brief introduction of realsense d435i imaging principle
Gan network thought
Ensemble, série shuishu] jour 9
今天很多 CTO 都是被干掉的,因为他没有成就业务
Altaro virtual machine replication failed: "unsupported file type vmgs"
Altaro VM backup getting started
