apiVersion: v1
kind: Pod
metadata:
name: liveness-tcp
namespace: default
spec:
containers:
- name: liveness-tcp-container
image: httpd
imagePullPolicy: IfNotPresent
livenessProbe:
initialDelaySeconds: 5
timeoutSeconds: 10
tcpSocket:
port: 8080
periodSeconds: 3
镜像默认端口应该是80,但是yaml文件故意写成8080,tcp检测失败,pod会反复执行重启操作知道检测到80端口
来源:51CTO
作者:头发太长l
链接:https://blog.51cto.com/11954248/2477637