-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment variable expansion in spec.config.service.telemetry.metrics.address
doesn't work
#3513
Comments
mine workaround manager:
env:
ENABLE_WEBHOOKS: "false" |
I didnt test it yet, but did you try: - address: ${env:POD_IP}:8888
+ address: "${env:POD_IP}:8888" |
Same problem. Adding double quotes does not solve the issue. |
The webhook really shouldn't reject the Collector CR just because it can't parse the metrics port. This happens because manifest building fails here, again because we error if we fail to parse the endpoint, whereas we should emit a warning and proceed. |
@swiatekm agreed with everything you said. I have a PR that I'm working on to fix the issue. Will add the warning log as you mentioned after I fix some linting issues and add a few more tests over there. |
For reference, we ended up returning the error after all. Creating the metrics Service (and ServiceMonitor, if present) is controlled by the Collector CR attribute |
Component(s)
collector
What happened?
Description
Looks like the shell environment variable expansion breaks config validation when used in
spec.config.service.telemetry.metrics.address
.It doesn't break the config validation when used in other places, like
spec.config.receivers.otlp.protocols.grpc.endpoint
.Steps to Reproduce
Expected Result
The Collector is created.
Actual Result
It returns the error
Error from server (Forbidden): error when creating "collector_crd.yaml": admission webhook "mopentelemetrycollectorbeta.kb.io" denied the request: address ${env:POD_IP}:8888: too many colons in address
Kubernetes Version
1.31.2
Operator version
0.114.0
Collector version
0.114.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
Log output
No response
Additional context
According to https://github.com/open-telemetry/opentelemetry-helm-charts/blob/831603f1351049a65550ec3211d8e3a44a0c5a2a/charts/opentelemetry-collector/UPGRADING.md#0782-to-0783, it would be a good idea to update all the examples to use
${env:POD_IP}
instead of listening on0.0.0.0
.The text was updated successfully, but these errors were encountered: