Skip to content

fix: permit optional ports for sidecars so we can run sidecars#450

Open
bdashrad wants to merge 7 commits into
GoogleCloudPlatform:mainfrom
lighttouchtechnology:fix/sidecar-ports
Open

fix: permit optional ports for sidecars so we can run sidecars#450
bdashrad wants to merge 7 commits into
GoogleCloudPlatform:mainfrom
lighttouchtechnology:fix/sidecar-ports

Conversation

@bdashrad

Copy link
Copy Markdown

This is another attempt at #381 to resolve #302.

@bdashrad

Copy link
Copy Markdown
Author

@q2w @prabhu34 @krprabhat-eng @ayushmjain @anamer if you have a moment, could you take a look at this PR, or the prior one #381? We need this to run sidecar containers with the v2 module. I've been running it myself for a few weeks in the fork, but hoping to get it merged back to the main branch.

@bdashrad

bdashrad commented Apr 6, 2026

Copy link
Copy Markdown
Author

Hi, I'm looking to see if there is anything I can do to help make this easier to review or prepare for merging.

@amandakarina

Copy link
Copy Markdown
Collaborator

/gcbrun

@amandakarina amandakarina changed the title fix: Permit optional ports for sidecars so we can run sidecars fix: permit optional ports for sidecars so we can run sidecars Apr 14, 2026
@amandakarina amandakarina changed the title fix: permit optional ports for sidecars so we can run sidecars fix: permit optional ports for sidecars so we can run sidecars Apr 14, 2026
@bdashrad

Copy link
Copy Markdown
Author

@amandakarina Thanks for looking. It seems like your /gcbrun comment didn't trigger the check.

@amandakarina

Copy link
Copy Markdown
Collaborator

/gcbrun

robbiet480 added a commit to CampusTech/fleet-terraform that referenced this pull request May 29, 2026
Adds two inputs to the gcp module so callers can wire OpenTelemetry
collectors (or any other sidecar) into the fleet-api Cloud Run service:

- sidecar_containers: list of arbitrary sidecar containers to colocate
  with Fleet. Lets users plug in DDOT, otelcol-contrib, Grafana Alloy,
  or any other observability agent that exposes an OTLP receiver on a
  localhost port.

- service_only_env_vars: extra env vars applied only to the Cloud Run
  service but not the migration job. The migration job runs as a Cloud
  Run Job without sidecars, so things like OTEL_EXPORTER_OTLP_ENDPOINT
  would point to a nonexistent listener during job execution.

Behavior is unchanged when both inputs use their empty defaults —
existing deployments don't need to update tfvars.

The new addons/gcp/otel-sidecar addon emits the corresponding Fleet env
vars (FLEET_LOGGING_TRACING_ENABLED, OTEL_EXPORTER_OTLP_*, etc.) in a
{universal, service_only} split so callers route them correctly. It
doesn't ship a sidecar container itself; the README has copy-pasteable
examples for OpenTelemetry Collector contrib and Datadog DDOT.

Multi-container Cloud Run services depend on
GoogleCloudPlatform/cloud-run/google//modules/v2 accepting sidecars
without a ports block, tracked in
GoogleCloudPlatform/terraform-google-cloud-run#450. Until that lands
upstream, callers using sidecar_containers will hit "exactly one
container with an exposed port" — documented in the addon README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloud run V2 - multi containers exposed port

3 participants