如何使用 helm chart 将 smtp 设置添加到 prometheus-operator?

How to add smtp settings to prometheus-operator using helm chart?

我是 Kubernetes 的新手,尤其是使用 helm。我安装了图表,它使用默认值工作正常。我想在图表的 values.yml 文件中添加 smtp 服务器设置。我对如何在安装图表时注入值感到困惑。这是我正在使用的图表 https://github.com/helm/charts/tree/master/stable/prometheus-operator。 使用默认值安装 helm chart 后,我​​看到有一个名为 prometheus-operator-grafana 的部署,它具有值 GF_SECURITY_ADMIN_USER 和 GF_SECURITY_ADMIN_PASSWORD 但我不确定这些值来自何处。 帮助了解这些值如何工作以及如何注入它们将不胜感激。

这个 SO 答案很好地总结了父图表值和子图表值之间的交互:

有两个独立的 grafana 图表机制可以控制这样的事情:adminUser and adminPassword or admin.existingSecret along with admin.userKey and admin.passwordkey

因此,helm ... --set grafana.adminUser=ninja --set grafana.adminPassword=hunter2 将如您所愿。 The fine manual 甚至说他们正在使用 grafana 作为子图表,并将该确切设置记录为 grafana.enabled 设置下的第一个值。请随意提交有关 helm chart 的问题以花费额外的字符并记录 grafana.adminUser 设置