OpenTelemetry Operator - 无法注入自动仪器库

Saj*_*jid 5 kubernetes telemetry open-telemetry

我们计划使用开放遥测作为我们所有应用程序的标准,并且我们已经安装了 opentelemetry-operator 的 Kubernetes 集群之一。otl 收集器和仪器运行良好。当我们将注释(instrumentation.opentelemetry.io/inject-dotnet: opentelemetry-operator-system/my-instrumentation)添加到其中一个.Net部署时,它无法注入库并在日志中显示如下。我们正在使用非 root 用户运行所有部署/pod。请帮助我如何解决它。

2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration.binder/7.0.0/lib/net7.0': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration.binder/7.0.0/lib': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration.binder/7.0.0': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration.binder': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/runtimes/win/native/libzstd.dll': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/runtimes/win/native/snappy32.dll': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/runtimes/win/native/snappy64.dll': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/runtimes/win/native': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/runtimes/win': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/runtimes': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/lib/netstandard2.1/MongoDB.Driver.Core.dll': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/lib/netstandard2.1': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3/lib': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core/2.13.3': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/mongodb.driver.core': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration/7.0.0/lib/net7.0/Microsoft.Extensions.Configuration.dll': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration/7.0.0/lib/net7.0': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration/7.0.0/lib': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration/7.0.0': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0/microsoft.extensions.configuration': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64/net7.0': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store/x64': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/./store': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve times of '/otel-auto-instrumentation/.': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve ownership of '/otel-auto-instrumentation/.': Operation not permitted
2023-04-04T00:57:56-04:00 cp: can't preserve permissions of '/otel-auto-instrumentation/.': Operation not permitted
Run Code Online (Sandbox Code Playgroud)

小智 0

这是因为权限问题,您可能已经在 yaml 文件中定义了runasnonroot,这会阻止从 init-container 到您的应用程序容器的 cp 操作。即使您配置了runasuser,您仍然遇到问题。