Merge pull request #639 from yekkhan/main
Some checks are pending
Fly Deploy / Pre-deploy checks (push) Waiting to run
Fly Deploy / Deploy app (push) Blocked by required conditions

feat: kubernetes example optimization
This commit is contained in:
Nicolas 2024-09-19 18:59:42 -04:00 committed by GitHub
commit 74565a9da3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 3 deletions

View File

@ -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.
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.

View File

@ -1,6 +1,14 @@
# 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
- **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
@ -38,4 +46,4 @@ kubectl delete -f playwright-service.yaml
kubectl delete -f api.yaml
kubectl delete -f worker.yaml
kubectl delete -f redis.yaml
```
```

View File

@ -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

View File

@ -17,3 +17,4 @@ data:
STRIPE_PRICE_ID_SCALE: ""
HYPERDX_API_KEY: ""
FIRE_ENGINE_BETA_URL: ""
REDIS_PASSWORD: ""