From 7685853d8a39e5e645dc733c2f29c63254519946 Mon Sep 17 00:00:00 2001 From: y5n Date: Sat, 7 Sep 2024 13:50:47 +0800 Subject: [PATCH 1/3] [Fix] fix SELF_HOST.md kubernetes cluster-install link --- SELF_HOST.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SELF_HOST.md b/SELF_HOST.md index 2fa87776..dc8a1cf9 100644 --- a/SELF_HOST.md +++ b/SELF_HOST.md @@ -176,4 +176,4 @@ By addressing these common issues, you can ensure a smoother setup and operation ## Install Firecrawl on a Kubernetes Cluster (Simple Version) -Read the [examples/kubernetes-cluster-install/README.md](https://github.com/mendableai/firecrawl/blob/main/examples/kubernetes-cluster-install/README.md) for instructions on how to install Firecrawl on a Kubernetes Cluster. \ No newline at end of file +Read the [examples/kubernetes/cluster-install/README.md](https://github.com/mendableai/firecrawl/blob/main/examples/kubernetes/cluster-install/README.md) for instructions on how to install Firecrawl on a Kubernetes Cluster. \ No newline at end of file From 1ea9131e63d86d906cfef9ac460c15aad08744ac Mon Sep 17 00:00:00 2001 From: y5n Date: Sat, 7 Sep 2024 16:00:32 +0800 Subject: [PATCH 2/3] feat: Update redis deployment to run redis with password if REDIS_PASSWORD is configured --- examples/kubernetes/cluster-install/README.md | 9 +++++++++ examples/kubernetes/cluster-install/redis.yaml | 17 ++++++++++++++++- examples/kubernetes/cluster-install/secret.yaml | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/examples/kubernetes/cluster-install/README.md b/examples/kubernetes/cluster-install/README.md index 736ae038..78bb6133 100644 --- a/examples/kubernetes/cluster-install/README.md +++ b/examples/kubernetes/cluster-install/README.md @@ -1,6 +1,15 @@ # Install Firecrawl on a Kubernetes Cluster (Simple Version) # Before installing 1. Set [secret.yaml](secret.yaml) and [configmap.yaml](configmap.yaml) and do not check in secrets + Here's the modified markdown with the statement you requested: + - **Note**: If `REDIS_PASSWORD` is configured in the secret, please modify the ConfigMap to reflect the following format for `REDIS_URL` and `REDIS_RATE_LIMIT_URL`: + ```yaml + REDIS_URL: "redis://:password@host:port" + REDIS_RATE_LIMIT_URL: "redis://:password@host:port" + ``` + Replace `password`, `host`, and `port` with the appropriate values. + + 2. Build Docker images, and host it in your Docker Registry (replace the target registry with your own) 1. API (which is also used as a worker image) 1. ```bash diff --git a/examples/kubernetes/cluster-install/redis.yaml b/examples/kubernetes/cluster-install/redis.yaml index 774d3712..855567f1 100644 --- a/examples/kubernetes/cluster-install/redis.yaml +++ b/examples/kubernetes/cluster-install/redis.yaml @@ -15,7 +15,22 @@ spec: containers: - name: redis image: redis:alpine - args: ["redis-server", "--bind", "0.0.0.0"] + command: [ "/bin/sh", "-c" ] # Run a shell script as entrypoint + args: + - | + if [ -n "$REDIS_PASSWORD" ]; then + echo "Starting Redis with authentication" + exec redis-server --bind 0.0.0.0 --requirepass "$REDIS_PASSWORD" + else + echo "Starting Redis without authentication" + exec redis-server --bind 0.0.0.0 + fi + env: + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: firecrawl-secret + key: REDIS_PASSWORD --- apiVersion: v1 kind: Service diff --git a/examples/kubernetes/cluster-install/secret.yaml b/examples/kubernetes/cluster-install/secret.yaml index 6d8eed3b..3cbab7a7 100644 --- a/examples/kubernetes/cluster-install/secret.yaml +++ b/examples/kubernetes/cluster-install/secret.yaml @@ -17,3 +17,4 @@ data: STRIPE_PRICE_ID_SCALE: "" HYPERDX_API_KEY: "" FIRE_ENGINE_BETA_URL: "" + REDIS_PASSWORD: "" From 4278fae51e8c3f2bd33b1e473cf6bb40bfa02677 Mon Sep 17 00:00:00 2001 From: y5n <37255936+yekkhan@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:55:31 +0800 Subject: [PATCH 3/3] Update README.md --- examples/kubernetes/cluster-install/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/kubernetes/cluster-install/README.md b/examples/kubernetes/cluster-install/README.md index 78bb6133..6febc616 100644 --- a/examples/kubernetes/cluster-install/README.md +++ b/examples/kubernetes/cluster-install/README.md @@ -1,7 +1,6 @@ # Install Firecrawl on a Kubernetes Cluster (Simple Version) # Before installing 1. Set [secret.yaml](secret.yaml) and [configmap.yaml](configmap.yaml) and do not check in secrets - Here's the modified markdown with the statement you requested: - **Note**: If `REDIS_PASSWORD` is configured in the secret, please modify the ConfigMap to reflect the following format for `REDIS_URL` and `REDIS_RATE_LIMIT_URL`: ```yaml REDIS_URL: "redis://:password@host:port" @@ -47,4 +46,4 @@ kubectl delete -f playwright-service.yaml kubectl delete -f api.yaml kubectl delete -f worker.yaml kubectl delete -f redis.yaml -``` \ No newline at end of file +```