Add Cloudflare Tunnel sidecar to Cloud Run deployment#11
Conversation
Co-authored-by: MrOrz <108608+MrOrz@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Cloud Run deployment by introducing a Cloudflare Tunnel sidecar. This integration allows for secure, direct connectivity to the Cloud Run service via Cloudflare, bypassing traditional ingress configurations. The changes ensure the tunnel operates efficiently with appropriate resource allocation and stable CPU performance. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a Cloudflare Tunnel sidecar to the Cloud Run deployment. The configuration correctly disables CPU throttling for instance stability and sets up the cloudflared container with resource limits and secret handling. However, there are two key issues to address. First, the container image uses the :latest tag, which is not recommended for production as it can lead to unpredictable deployments; a specific version should be pinned. Second, and more critically, the TUNNEL_URL for the sidecar is configured to point to port 8080, but the ingress container it should be forwarding traffic to is running on port 3000. This misconfiguration will prevent the tunnel from functioning correctly.
| name: CLOUDFLARE_TUNNEL_TOKEN | ||
| key: latest | ||
| - name: TUNNEL_URL | ||
| value: "http://localhost:8080" |
There was a problem hiding this comment.
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"| periodSeconds: 10 | ||
| failureThreshold: 6 | ||
| - name: cloudflared | ||
| image: cloudflare/cloudflared:latest |
There was a problem hiding this comment.
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…N using envsubst Co-authored-by: MrOrz <108608+MrOrz@users.noreply.github.com>
Co-authored-by: MrOrz <108608+MrOrz@users.noreply.github.com>
Co-authored-by: MrOrz <108608+MrOrz@users.noreply.github.com>
|
We cannot setup tunnels for each PR, give up tunnel solution |
Added
cloudflaredcontainer toservice.template.yamlto support Cloudflare Tunnel sidecar architecture.Changes included:
TUNNEL_TOKENfrom Google Secret Manager (CLOUDFLARE_TUNNEL_TOKEN) usingvalueFrom.secretKeyRef.TUNNEL_URLenvironment variable for network connectivity targetinghttp://localhost:8080.run.googleapis.com/cpu-throttling: "false") to ensure instance stability for the tunnel.100mvCPU and128MiMemory.PR created automatically by Jules for task 1605954862584609923 started by @MrOrz