kind: Pod
metadata:
labels:
test: exec-readinessprobe
name: readinessprobe
spec:
containers:
– name: exec-readinessprobe
image: busybox:latest
args: [\”/bin/sh\”,\”-c\”,\”touch /tmp/test.txt\”]
readinessProbe:
exec:
command: [\”test\”,\”-e\”,\”/tmp/test.txt\”] –探測文件是否存在,如果存在立即進入就緒性
initialDelaySeconds: 5 –Pod初使化完成后使用command命令進行探測(5秒)
periodSeconds: 5 –探測周期5秒
[root@k8s01 yaml ]# kubectl apply -f execreadiness.yaml
pod/readinessprobe created
[root@k8s01 yaml ]#
上述內(nèi)容就是如何實現(xiàn)Pod就緒性探測,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關(guān)注資訊頻道。
更多關(guān)于云服務(wù)器,域名注冊,虛擬主機的問題,請訪問西部數(shù)碼官網(wǎng):www.ps-sw.cn