Liveness probe is not defined 이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우
언제든지 연락주시기 바랍니다. Id: kubernetes-liveness-probe-is-not-defined
Platform: Kubernetes
Severity: Low
Category: Availability
Learn More Description A liveness probe can improve availability by restarting unresponsive containers but can also cause cascading failures. Define a livenessProbe only when necessary and configure it to avoid unintended restarts. This rule flags containers that do not include a livenessProbe, excluding Job and CronJob resource kinds.
Compliant Code Examples apiVersion : v1
kind : Pod
metadata :
labels :
test : liveness
name : liveness-exec
spec :
containers :
- name : liveness
image : k8s.gcr.io/busybox
args :
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
livenessProbe :
exec :
command :
- cat
- /tmp/healthy
initialDelaySeconds : 5
periodSeconds : 5
---
apiVersion : batch/v1beta1
kind : CronJob
metadata :
name : hello
spec :
schedule : "*/1 * * * *"
jobTemplate :
spec :
template :
spec :
containers :
- name : hello
image : busybox
imagePullPolicy : IfNotPresent
args :
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy : OnFailure
Non-Compliant Code Examples apiVersion : v1
kind : Pod
metadata :
labels :
test : liveness
name : liveness-exec
spec :
containers :
- name : liveness
image : k8s.gcr.io/busybox
args :
- /bin/sh
- -c
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600