当前位置:网站首页>[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
边栏推荐
- 卷积神经网络CNN中的卷积操作详解
- "C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
- Export the altaro event log to a text file
- MySQL 5.7.32-winx64 installation tutorial (support installing multiple MySQL services on one host)
- AtCoder Beginner Contest 258(A-D)
- How does win7 solve the problem that telnet is not an internal or external command
- How to set up altaro offsite server for replication
- Explanation of variables, code blocks, constructors, static variables and initialization execution sequence of static code blocks of Ali interview questions
- QT read write excel -- qxlsx insert chart 5
- [set theory] relational closure (reflexive closure | symmetric closure | transitive closure)
猜你喜欢

Apache+php+mysql environment construction is super detailed!!!

Personal outlook | looking forward to the future from Xiaobai's self analysis and future planning

Altaro set grandfather parent child (GFS) archiving
![[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation](/img/9b/a309607c037b0a18ff6b234a866f9f.jpg)
[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation

About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller

Why is the website slow to open?

SimpleITK学习笔记

Exception when introducing redistemplate: noclassdeffounderror: com/fasterxml/jackson/core/jsonprocessingexception

Redis使用Lua脚本简介

3dslam with 16 line lidar and octomap
随机推荐
Crontab command usage
[untitled]
NG Textarea-auto-resize
卷积神经网络CNN中的卷积操作详解
Latest version of source insight
Final review Day8
Solve the problem of automatic disconnection of SecureCRT timeout connection
[written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis
About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
Best practices for setting up altaro VM backups
Btrfs and ext4 - features, strengths and weaknesses
Detailed explanation of iptables (1): iptables concept
[together Shangshui Shuo series] day 7 content +day8
EMD distance - example of use
Explanation of variables, code blocks, constructors, static variables and initialization execution sequence of static code blocks of Ali interview questions
Notepad++ wrap by specified character
中职网络子网划分例题解析
CAD插件的安装和自动加载dll、arx
Altaro virtual machine replication failed: "unsupported file type vmgs"
Today, many CTOs were killed because they didn't achieve business
