Skip to content

Support of volumeMounts in sidecars#1759

Open
Sgitario wants to merge 1 commit intoRedHatInsights:masterfrom
Sgitario:support_volume_mounts_sidecars
Open

Support of volumeMounts in sidecars#1759
Sgitario wants to merge 1 commit intoRedHatInsights:masterfrom
Sgitario:support_volume_mounts_sidecars

Conversation

@Sgitario
Copy link
Copy Markdown
Contributor

@Sgitario Sgitario commented Apr 2, 2026

Summary

The Clowder Sidecar API currently does not support custom volumeMounts, which prevents use cases like sharing a log directory between the main container and the otel-collector sidecar. This is needed for file-based log collection (filelog receiver), where the application writes logs to a shared volume and the otel-collector tails them for forwarding to Splunk/SumoLogic.

The filelog approach is preferred over alternatives like syslog or tcplog because it requires zero coupling with the application — the app just writes to a file (which frameworks like Spring Boot, Quarkus, and NGINX already support natively), and the collector picks them up independently. It's also resilient to collector restarts since logs persist in the shared volume.

Changes

  • API: Add optional volumeMounts field ([]v1.VolumeMount) to the Sidecar struct in clowdapp_types.go. Fully backward compatible (omitempty).
  • Provider: Append custom volume mounts after the default ConfigMap mount in getOtelCollector().
  • Unit tests: 4 new test cases covering no mounts, single mount, multiple mounts (with readOnly), nil sidecar, and empty slice.
  • Kuttl integration test: New test-sidecars-volume-mounts suite with 3 scenarios: baseline (no custom mounts), single shared volume, and multiple volumes.

Test plan

  • Unit tests pass (go test ./controllers/cloud.redhat.com/providers/sidecar/... -v)
  • Kuttl integration tests pass in CI (make kuttl KUTTL_TEST="--test=test-sidecars-volume-mounts")
  • Existing sidecar kuttl tests still pass (no regressions)

@EliadCohen EliadCohen requested a review from maknop April 7, 2026 20:37
Sgitario added a commit to RedHatInsights/rhsm-subscriptions that referenced this pull request Apr 8, 2026
…#5950)

Jira issue: SWATCH-3960

## Description
The swatch-api-nginx-proxy service was never configured to send logs to
Splunk HEC. To start doing this, we will configure the existing otel
collector sidecar to send the logs:
- The service will send the logs via syslog (in the future, it will be
using file logs, but at the moment, Clowder does not support mounting
volumes that would allow us to process files:
RedHatInsights/clowder#1759 to add this feature
request).
- The otel collector sidecar will mount a new configmap that includes
logging. In ephemeral, it will simply log the statements to stdout. In
stage, it will use the configmap from
https://gitlab.cee.redhat.com/rhsm/splunk-otel-collector/-/merge_requests/11.

## Testing
Steps:
1. Deploy all our services using the bonfire command from the iqe
pipelines (important to use the same template ref).
2. Deploy the new configmap that includes the logging via syslog (UDP)
from
https://gitlab.cee.redhat.com/rhsm/splunk-otel-collector/-/blob/main/deploy/splunk-otel-collector.yaml?ref_type=heads#L417
3. Delete the swatch-api-nginx-proxy pods, so these are recreated.
@bsquizz
Copy link
Copy Markdown
Contributor

bsquizz commented Apr 14, 2026

/test-e2e

bsquizz
bsquizz previously approved these changes Apr 14, 2026
@bsquizz
Copy link
Copy Markdown
Contributor

bsquizz commented Apr 14, 2026

One of the new kuttl tests failed if you're able to take a look:

--- FAIL: kuttl/harness/test-sidecars-volume-mounts (610.44s)

@Sgitario Sgitario force-pushed the support_volume_mounts_sidecars branch from ff0592e to 3c912c6 Compare April 14, 2026 17:10
@Sgitario
Copy link
Copy Markdown
Contributor Author

/test-e2e

@github-actions
Copy link
Copy Markdown

@Sgitario Sorry, you don't have permission to trigger E2E tests. This command is restricted to repository maintainers.

@Sgitario
Copy link
Copy Markdown
Contributor Author

@bsquizz I don't have permission to run the e2e tests. Can you trigger it please?

@JuanmaBM
Copy link
Copy Markdown
Contributor

/test-e2e

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.

3 participants