Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ jobs:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }}
LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
CLOUDFLARE_TUNNEL_TOKEN: ${{ secrets.CLOUDFLARE_TUNNEL_TOKEN }}
run: |
envsubst '${FRONTEND_IMAGE} ${BACKEND_IMAGE} ${TRAFFIC_BLOCK} ${GOOGLE_API_KEY} ${LANGFUSE_PUBLIC_KEY} ${LANGFUSE_SECRET_KEY}' < service.template.yaml > service.yaml
envsubst '${FRONTEND_IMAGE} ${BACKEND_IMAGE} ${TRAFFIC_BLOCK} ${GOOGLE_API_KEY} ${LANGFUSE_PUBLIC_KEY} ${LANGFUSE_SECRET_KEY} ${CLOUDFLARE_TUNNEL_TOKEN}' < service.template.yaml > service.yaml
cat service.yaml

- name: Deploy to Cloud Run
Expand Down
13 changes: 13 additions & 0 deletions service.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
run.googleapis.com/container-dependencies: '{"ingress":["backend"]}'
autoscaling.knative.dev/minScale: "0"
autoscaling.knative.dev/maxScale: "3"
run.googleapis.com/cpu-throttling: "false"
spec:
containers:
- name: ingress
Expand Down Expand Up @@ -52,4 +53,16 @@ spec:
timeoutSeconds: 5
periodSeconds: 10
failureThreshold: 6
- name: cloudflared
image: cloudflare/cloudflared:latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using the :latest tag for container images is not recommended in production environments. It can lead to unpredictable behavior when a new version is pushed to the registry, and it makes it difficult to track which version of the image is running or to roll back to a previous version. It's best practice to pin to a specific, immutable image tag (e.g., a version number or a git SHA).

        image: cloudflare/cloudflared:2024.5.1

args: ["tunnel", "--no-autoupdate", "run"]
env:
- name: TUNNEL_TOKEN
value: "${CLOUDFLARE_TUNNEL_TOKEN}"
- name: TUNNEL_URL
value: "http://localhost:8080"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The TUNNEL_URL is configured to point to http://localhost:8080, but no container is listening on this port. The ingress container, which serves the frontend, is configured to listen on port 3000. The tunnel should forward traffic to the ingress container. Please update the port to 3000 for the tunnel to work correctly.

          value: "http://localhost:3000"

resources:
limits:
cpu: "100m"
memory: "128Mi"
${TRAFFIC_BLOCK}
Loading