feat(nr-k8s-otel-collector): add initContainer to fix ATP storage per…#2199
Open
gmanandhar-nr wants to merge 2 commits intomasterfrom
Open
feat(nr-k8s-otel-collector): add initContainer to fix ATP storage per…#2199gmanandhar-nr wants to merge 2 commits intomasterfrom
gmanandhar-nr wants to merge 2 commits intomasterfrom
Conversation
Philip-R-Beckwith
requested changes
Apr 1, 2026
Contributor
Philip-R-Beckwith
left a comment
There was a problem hiding this comment.
This seems overly heavy handed.
Why are we not using K8s built in fsGroup to fix the permissions issue?
Member
Author
|
Using fsGroup would be cleaner. However, fsGroup doesn't work with hostPath volumes, which is what we're using here. The reason we use hostPath is because
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When ATP (Adaptive Telemetry Processor) is enabled, the collector fails to persist state with the following
error:
Error: open /var/lib/nrdot-collector/adaptiveprocess.db: permission denied
Root Cause: The
hostPathvolume at/var/lib/nrdot-collectoris created by Kubernetes withroot:rootownership, but the main container runs as user
1001(non-root), preventing ATP from writing the persistencedatabase.
Solution
Added a new
fix-atp-storage-permissionsinitContainer that:enable_atp: true(conditional rendering)/var/lib/nrdot-collectorto1001:1001before the main container startsbitnami/kubectlimage (no new dependencies)Security
The initContainer runs with minimal privileges:
runAsUser: 0(required forchown)allowPrivilegeEscalation: false(prevents privilege escalation attacks)capabilities: drop: [ALL], add: [CHOWN, DAC_OVERRIDE](only necessary capabilities)Backward Compatibility
No impact on existing installations:
{{- if .Values.enable_atp }}conditional