Difference between revisions of "Kubernetes probes"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
  
[[readinessProbe]]
+
* <code>[[readinessProbe]]</code>
[[livenessProbe]]
+
* <code>[[livenessProbe]]</code>
[[StartupProbe]]
+
* <code>[[StartupProbe]]</code>
  
[[httpGet]]
+
Check mechanisms:
[[tcpSocket]]
+
* <code>[[exec]]</code>
 +
* <code>[[grpc]]</code>
 +
* <code>[[httpGet]]: [[httpHeaders]]</code>
 +
* <code>[[tcpSocket]]</code>
  
 
  [[kind: Deployment]]
 
  [[kind: Deployment]]
 +
 +
<pre>
 +
apiVersion: v1
 +
kind: Pod
 +
metadata:
 +
  labels:
 +
    test: liveness
 +
  name: liveness-exec
 +
spec:
 +
  containers:
 +
  - name: liveness
 +
    image: registry.k8s.io/busybox
 +
    args:
 +
    - /bin/sh
 +
    - -c
 +
    - touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 600
 +
    livenessProbe:
 +
      exec:
 +
        command:
 +
        - cat
 +
        - /tmp/healthy
 +
      initialDelaySeconds: 5
 +
      periodSeconds: 5
 +
</pre>
  
  
Line 13: Line 41:
  
 
== Related ==
 
== Related ==
[[customStartupProbe]]
+
* <code>[[Redis values.yml]]</code>
[[customLivenessProbe]]
+
* <code>[[customStartupProbe]]</code>
[[customReadinessProbe]]
+
* <code>[[customLivenessProbe]]</code>
 +
* <code>[[customReadinessProbe]]</code>
 +
* [[Kubernetes restartPolicy]]
 +
* [[CrashLoopBackOff]]
 +
* [[Unknown]]
  
 
== See also ==
 
== See also ==

Latest revision as of 10:00, 1 May 2024

Check mechanisms:

kind: Deployment
apiVersion: v1
kind: Pod
metadata:
  labels:
    test: liveness
  name: liveness-exec
spec:
  containers:
  - name: liveness
    image: registry.k8s.io/busybox
    args:
    - /bin/sh
    - -c
    - touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 600
    livenessProbe:
      exec:
        command:
        - cat
        - /tmp/healthy
      initialDelaySeconds: 5
      periodSeconds: 5


readinessProbe:
  httpGet:
    path: /api/health
    port: 3000

livenessProbe:
  httpGet:
    path: /api/health
    port: 3000
  initialDelaySeconds: 60
  timeoutSeconds: 30
  failureThreshold: 10

Related[edit]

See also[edit]

Advertising: