fix(gateway-addons-helm): enable kubernetesAttributes preset for OpenTelemetry Collector #7791
+79
−1
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.
What this PR fixes
When deploying the
gateway-addons-helmchart with only OpenTelemetry Collector enabled (opentelemetry-collector.enabled: true), the collector pod logs RBAC errors because no ClusterRole/ClusterRoleBinding is created for theotel-collectorservice account.Error example from issue #7726:
pods is forbidden: User "system:serviceaccount:gateway-api-resources:otel-collector" cannot list resource "pods" at the cluster scope replicasets.apps is forbidden: User "system:serviceaccount:gateway-api-resources:otel-collector" cannot list resource "replicasets" namespaces "kube-system" is forbidden: User "system:serviceaccount:gateway-api-resources:otel-collector" cannot list resource "namespaces"Root cause
The OpenTelemetry Collector subchart only creates RBAC when either:
clusterRole.create: trueORkubernetesAttributes.enabled: true)The
gateway-addons-helmchart's default values don't enable any presets, so when users enable only the collector, they get no RBAC.Solution
Enable the
kubernetesAttributespreset by default in the OpenTelemetry Collector configuration. This preset provides exactly the permissions shown in the error logs:podsandnamespaces(for Kubernetes discovery)replicasets(for pod owner references)The change adds 5 lines after
fullnameOverride: otel-collectorinvalues.yaml: