当前位置:网站首页>[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
边栏推荐
- [minesweeping of two-dimensional array application] | [simple version] [detailed steps + code]
- 期末复习(Day5)
- 中职网络子网划分例题解析
- 32GB Jetson Orin SOM 不能刷机问题排查
- 2022.6.30DAY591
- Introduction to redis using Lua script
- Es 2022 officially released! What are the new features?
- 卷积神经网络CNN中的卷积操作详解
- How do I migrate my altaro VM backup configuration to another machine?
- Solve the problem of automatic disconnection of SecureCRT timeout connection
猜你喜欢

@Autowired 导致空指针报错 解决方式

Win10 install pytullet and test
![[minesweeping of two-dimensional array application] | [simple version] [detailed steps + code]](/img/b0/aa5dce0bb60c50eea907de9e127d6c.jpg)
[minesweeping of two-dimensional array application] | [simple version] [detailed steps + code]

MySQL 5.7.32-winx64 installation tutorial (support installing multiple MySQL services on one host)

6.23 warehouse operation on Thursday
![[function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation](/img/c2/991b8febd262cf9237017adc9d1221.jpg)
[function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation

2022.DAY592
![[Shangshui Shuo series together] day 10](/img/a3/e8b9df588bef67ead925813a75c8c0.png)
[Shangshui Shuo series together] day 10

Simpleitk learning notes

Gan network thought
随机推荐
ES 2022 正式发布!有哪些新特性?
Source insight automatic installation and licensing
Personal outlook | looking forward to the future from Xiaobai's self analysis and future planning
Detailed explanation of iptables (1): iptables concept
Final review (Day7)
一起上水硕系列】Day 9
Altaro set grandfather parent child (GFS) archiving
Btrfs and ext4 - features, strengths and weaknesses
期末复习(day3)
Get and monitor remote server logs
Shanghai daoning, together with American /n software, will provide you with more powerful Internet enterprise communication and security component services
[set theory] relational closure (relational closure related theorem)
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]
为什么网站打开速度慢?
Export the altaro event log to a text file
Together, Shangshui Shuo series] day 9
DEX net 2.0 for crawl detection
[advanced pointer (1)] | detailed explanation of character pointer, pointer array, array pointer
Redhat7 system root user password cracking
[teacher Zhao Yuqiang] MySQL high availability architecture: MHA
