Difference between revisions of "Kubernetes probes"

From wikieduonline
Jump to navigation Jump to search
Line 10: Line 10:
  
 
  [[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>
  
  

Revision as of 12:50, 7 February 2024


readinessProbe
livenessProbe
StartupProbe
httpGet
tcpSocket
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

See also

Advertising: