From 895e80caa421e07f14f7c7e7496e2a86f72db198 Mon Sep 17 00:00:00 2001 From: Jakob Stadlhuber Date: Wed, 24 Jul 2024 19:00:23 +0200 Subject: [PATCH] Add liveness and readiness probes to Kubernetes configs Introduced liveness and readiness probes for the Playwright service, API, and worker components. This ensures that Kubernetes can better manage the health and availability of these services by periodically checking their endpoints. This enhancement will improve the robustness and reliability of the deployed applications. --- examples/kubernetes/cluster-install/api.yaml | 20 +++++++++++++++++++ .../cluster-install/playwright-service.yaml | 20 +++++++++++++++++++ .../kubernetes/cluster-install/worker.yaml | 20 +++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/examples/kubernetes/cluster-install/api.yaml b/examples/kubernetes/cluster-install/api.yaml index 81e61839..c709857c 100644 --- a/examples/kubernetes/cluster-install/api.yaml +++ b/examples/kubernetes/cluster-install/api.yaml @@ -26,6 +26,26 @@ spec: name: firecrawl-config #- secretRef: # name: firecrawl-secret + - livenessProbe: + httpGet: + path: /v0/health/liveness + port: 3002 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + name: api-container + - readinessProbe: + httpGet: + path: /v0/health/readiness + port: 3002 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + name: api-container --- apiVersion: v1 kind: Service diff --git a/examples/kubernetes/cluster-install/playwright-service.yaml b/examples/kubernetes/cluster-install/playwright-service.yaml index e916d914..a9c24d42 100644 --- a/examples/kubernetes/cluster-install/playwright-service.yaml +++ b/examples/kubernetes/cluster-install/playwright-service.yaml @@ -30,6 +30,26 @@ spec: envFrom: - configMapRef: name: playwright-service-config + - livenessProbe: + httpGet: + path: /health/liveness + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + name: playwright-service-container + - readinessProbe: + httpGet: + path: /health/readiness + port: 3000 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + name: playwright-service-container --- apiVersion: v1 kind: Service diff --git a/examples/kubernetes/cluster-install/worker.yaml b/examples/kubernetes/cluster-install/worker.yaml index 545beaa3..b904bd78 100644 --- a/examples/kubernetes/cluster-install/worker.yaml +++ b/examples/kubernetes/cluster-install/worker.yaml @@ -23,3 +23,23 @@ spec: name: firecrawl-config #- secretRef: # name: firecrawl-secret + - livenessProbe: + httpGet: + path: /v0/health/liveness + port: 3002 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + name: worker-container + - readinessProbe: + httpGet: + path: /v0/health/readiness + port: 3002 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 + name: worker-container \ No newline at end of file