英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论