以下是我的舵图
values.yaml
文件中的信息。
apps:
- name: acc1
uri: "https://google.com"
labels:
env: acc1
name: test1
- name: acc2
uri: "https://google.com"
labels:
env: acc2
name: test2
我想在 Terraform 的动态
set
块中使用它,并使用 helm_release
资源。如果我能得到一些同样的建议那就太好了
我将展示一种方法,可以帮助您轻松地做到这一点,而无需在 helm_release terraform 资源中设置嵌套值的任何复杂性。
在此示例中,我们将了解如何使用 terraform helm_release 资源部署 grafana helm 版本。您可以通过部署 grafana 版本进行测试。我们将使用values.yaml 文件来配置版本。
示例: Prometheus helm 发布 terraform 配置
resource "helm_release" "prometheus" {
name = "prometheus"
chart = "prometheus"
repository = "https://prometheus-community.github.io/helm-charts"
version = "14.8.0"
namespace = "prometheus"
values = [
"${file("values.yaml")}"
]
}
普罗米修斯values.yaml配置
server:
service:
type: ClusterIP
persistentVolume:
storageClass: "gp2"
这个例子在我看来效果很好。希望能解决您的问题