Difference between revisions of "ReadinessProbe"

From wikieduonline
Jump to navigation Jump to search
 
(8 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-tcp-liveness-probe
 
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-tcp-liveness-probe
  
 
+
* <code>[[helm show all grafana/grafana]]</code>
[[helm show all grafana/grafana]]
 
  
 
== Examples ==
 
== Examples ==
readinessProbe:
 
  httpGet:
 
    path: /api/health
 
    port: 3000
 
 
[[livenessProbe]]:
 
  httpGet:
 
    path: /api/health
 
    port: 3000
 
  initialDelaySeconds: 60
 
  timeoutSeconds: 30
 
  failureThreshold: 10
 
  
 +
{{example probes}}
  
 
== Official example ==
 
== Official example ==
<pre>
 
apiVersion: v1
 
 
kind: Pod
 
 
metadata:
 
 
  name: goproxy
 
 
  labels:
 
 
    app: goproxy
 
 
spec:
 
 
  containers:
 
 
  - name: goproxy
 
 
    image: registry.k8s.io/goproxy:0.1
 
 
    ports:
 
 
    - containerPort: 8080
 
 
    readinessProbe:
 
 
      tcpSocket:
 
 
        port: 8080
 
 
      initialDelaySeconds: 5
 
 
      periodSeconds: 10
 
 
    livenessProbe:
 
 
      tcpSocket:
 
 
        port: 8080
 
 
      initialDelaySeconds: 15
 
 
      periodSeconds: 20
 
 
</pre>
 
 
  
 +
apiVersion: v1
 +
[[kind: Pod]]
 +
metadata:
 +
  name: goproxy
 +
  labels:
 +
    app: goproxy
 +
spec:
 +
  [[containers:]]
 +
  - name: goproxy
 +
    image: registry.k8s.io/goproxy:0.1
 +
    ports:
 +
    - containerPort: 8080
 +
    [[readinessProbe:]]
 +
      [[tcpSocket]]:
 +
        port: 8080
 +
      initialDelaySeconds: 5
 +
      periodSeconds: 10
 +
    [[livenessProbe:]]
 +
      tcpSocket:
 +
        port: 8080
 +
      initialDelaySeconds: 15
 +
      periodSeconds: 20
  
 
== Related ==
 
== Related ==
 
* <code>[[LivenessProbe]]</code>
 
* <code>[[LivenessProbe]]</code>
 
* <code>[[kind: Pod]]</code>
 
* <code>[[kind: Pod]]</code>
 +
[[templates/deployment.yaml]]
  
 
== See also ==
 
== See also ==
 +
* {{K8s probes}}
 
* {{Pods}}
 
* {{Pods}}
  
 
[[Category:K8s]]
 
[[Category:K8s]]

Latest revision as of 11:05, 21 April 2024

Examples[edit]

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

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

Official example[edit]

apiVersion: v1
kind: Pod
metadata:
  name: goproxy
  labels:
    app: goproxy
spec:
  containers:
  - name: goproxy
    image: registry.k8s.io/goproxy:0.1
    ports:
    - containerPort: 8080
    readinessProbe:
      tcpSocket:
        port: 8080
      initialDelaySeconds: 5
      periodSeconds: 10
    livenessProbe:
      tcpSocket:
        port: 8080
      initialDelaySeconds: 15
      periodSeconds: 20

Related[edit]

templates/deployment.yaml

See also[edit]

Advertising: