elasticsearch - k8s 上的自动 elastic-apm .Net-Agent 配置
问题描述
我想自动将弹性凭据提供给我在同一个 k8s 集群上运行的 .net-Agent。
为了获取密码,我使用了他们文档中的以下脚本:
USERNAME="elastic"
PW=$(kubectl get secret "$NAME-es-elastic-user" -o go-template='{{.data.elastic | base64decode }}')
在他们的文档中,他们提到我可以使用凭据作为 API 密钥
... where {credentials} is the base64 encoding of id and api_key joined by a colon.
Alternatively, you can create a user and use their username and password to authenticate API access: -u $USER:$PASSWORD.
我尝试使用elastic:generatedpassword
和 base64 编码的字符串相同。两者都不起作用并给出(“语法”或身份验证)错误:
fail: Elastic.Apm[0]
{PayloadSenderV2} Failed sending event. Events intake API absolute URL: https://elastic-apm-http:8200/intake/v2/events. APM Server response: status code: Unauthorized, content:
{"error":"authentication failed: illegal base64 data at input byte 7"}
fail: Elastic.Apm[0]
{PayloadSenderV2} Failed sending event. Events intake API absolute URL: https://elastic-apm-http:8200/intake/v2/events. APM Server response: status code: Unauthorized, content:
{"error":"authentication failed"}
所以我认为我可能误读了文档,并且密码身份验证不是Authorization: ApiKey {credentials}
标题中给出的通过,而是基本身份验证。(但是我不知道如何在 .net 代理中进行设置)另一种解决方案是使用 API 密钥。(在这里我也没有找到如何在 k8s 中获取它们的任何资源。但是我找到了一个用于创建密钥的 http-API——这可能是一个复杂的解决方法)
我正在寻找正确的(最好是最简单的)解决方案来获取 k8s 集群上的 elastic-apm 代理的配置。
解决方案
推荐阅读
- python - 寻找一种 Python 方法来处理正常关闭的日志文件
- javascript - 有输入时如何禁用搜索框的转换?
- netsuite - 在 isCategoryPage 方法中检测分类页面
- wpf - 无法为 Prism Project 6.3.0 加载 Prism.Wpf 7.1.0.172
- javascript - 在 asp.net 中捆绑后脚本无法正确呈现
- c# - gridview asp.net的超链接字段错误
- asp.net - 一个潜在危险的请求
- python - Lasso.py 不包含在 github.com/scikit-learn 中
- java - dagger2 注入的非作用域对象的生命是什么?
- google-api - 如何将 drive.file oauth2 范围与 Google Drive 中的文件夹一起使用?