Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update self-hosted Kubernetes deployments examples for compatibility and consistency #1177

Merged
merged 6 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/api/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e

if [ $UID -eq 0 ]; then
if [ "$UID" -eq 0 ]; then
set +e # disable failing on errror
ulimit -n 65535
echo "NEW ULIMIT: $(ulimit -n)"
Expand All @@ -9,13 +9,13 @@ else
echo ENTRYPOINT DID NOT RUN AS ROOT
fi

if [ $FLY_PROCESS_GROUP = "app" ]; then
if [ "$FLY_PROCESS_GROUP" = "app" ]; then
echo "RUNNING app"
node --max-old-space-size=8192 dist/src/index.js
elif [ $FLY_PROCESS_GROUP = "worker" ]; then
elif [ "$FLY_PROCESS_GROUP" = "worker" ]; then
echo "RUNNING worker"
node --max-old-space-size=8192 dist/src/services/queue-worker.js
elif [ $FLY_PROCESS_GROUP = "index-worker" ]; then
elif [ "$FLY_PROCESS_GROUP" = "index-worker" ]; then
echo "RUNNING index worker"
node --max-old-space-size=8192 dist/src/services/indexing/index-worker.js
else
Expand Down
4 changes: 2 additions & 2 deletions examples/kubernetes/cluster-install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
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
docker build --no-cache -t ghcr.io/winkk-dev/firecrawl:latest ../../../apps/api
docker build --no-cache --platform linux/amd64 -t ghcr.io/winkk-dev/firecrawl:latest ../../../apps/api
docker push ghcr.io/winkk-dev/firecrawl:latest
```
2. Playwright
1. ```bash
docker build --no-cache -t ghcr.io/winkk-dev/firecrawl-playwright:latest ../../../apps/playwright-service
docker build --no-cache --platform linux/amd64 -t ghcr.io/winkk-dev/firecrawl-playwright:latest ../../../apps/playwright-service
docker push ghcr.io/winkk-dev/firecrawl-playwright:latest
```
3. Replace the image in [worker.yaml](worker.yaml), [api.yaml](api.yaml) and [playwright-service.yaml](playwright-service.yaml)
Expand Down
7 changes: 5 additions & 2 deletions examples/kubernetes/cluster-install/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ spec:
args: [ "pnpm", "run", "start:production" ]
ports:
- containerPort: 3002
env:
- name: FLY_PROCESS_GROUP
value: "app"
envFrom:
- configMapRef:
name: firecrawl-config
#- secretRef:
# name: firecrawl-secret
- secretRef:
name: firecrawl-secret
livenessProbe:
httpGet:
path: /v0/health/liveness
Expand Down
2 changes: 1 addition & 1 deletion examples/kubernetes/cluster-install/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ data:
HOST: "0.0.0.0"
REDIS_URL: "redis://redis:6379"
REDIS_RATE_LIMIT_URL: "redis://redis:6379"
PLAYWRIGHT_MICROSERVICE_URL: "http://playwright-service:3000/html"
PLAYWRIGHT_MICROSERVICE_URL: "http://playwright-service:3000"
USE_DB_AUTHENTICATION: "false"
HDX_NODE_BETA_MODE: "1"
7 changes: 5 additions & 2 deletions examples/kubernetes/cluster-install/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ spec:
image: ghcr.io/winkk-dev/firecrawl:latest
imagePullPolicy: Always
args: [ "pnpm", "run", "workers" ]
env:
- name: FLY_PROCESS_GROUP
value: "worker"
envFrom:
- configMapRef:
name: firecrawl-config
#- secretRef:
# name: firecrawl-secret
- secretRef:
name: firecrawl-secret