在Alertmanager中将密码存储在单独的文件中

huangapple go评论46阅读模式
英文:

Storing passwords in a separate file in Alertmanager

问题

我有一个Alertmanager配置,我想提交到一个公共存储库,以便其他人可以重新使用它。

但是,在Alertmanager配置中,我有我的令牌和密码,我不想公开它们。

是否有一种方法可以设置Alertmanager配置,以使密码存储在另一个文件或文件集中(这些文件将放在.gitignore下),以便Alertmanager可以从这些文件加载它们?

英文:

I have an Alertmanager setup that I want to commit to a repository to share publicly, so others can re-use it.

However, in Alertmanager config I have my tokens and passwords, which I do not want to make public.

Is there a way to set up an Alertmanager config in a way the passwords would be stored in another file or files set (which would be put under .gitignore), so Alertmanager would load them from these files?

答案1

得分: 0

Alertmanager本身不支持环境变量或配置替换。

最好的方法是在存储库配置文件中使用占位符,并在从存储库应用更改之前替换它们。

如果计划使用CI/CD从git应用更改,大多数服务器都具有准备好的功能,可以使用预定义值或来自秘密存储(如Vault)的值替换占位符。

英文:

Alertmanager doesn't support environment variables or configuration substitution itself.

The best you can do is to store in repository configuration file with placeholders, and substitue them before applying changes from repository to your deployment.

If you plan on using CI/CD for applying changes from git, most of the servers have ready functionality to substitute placeholders with predefined values or values from secret store, like Vault.

huangapple
  • 本文由 发表于 2023年5月6日 21:23:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76189128.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定