如何使用Helm提供商在TerraForm中覆盖默认图表值?
我们正在Terraform中使用Helm Provider来提供iStio Ingress网关,后者在后端使用此 noreflow noreferrer“ A>
下面是Terraform代码段,以提供相同的内容。请帮助覆盖默认图表值,以创建内部负载平衡器,而不是默认外部外部平衡器。我们知道可以通过更新清单文件中的注释来完成。但是不确定如何在Terraform代码段中执行相同的操作?
terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = ">= 1.0.0"
}
}
}
provider "helm" {
kubernetes {
config_path = "${var.kubeconfig_file}"
}
}
resource "helm_release" "istio-ingress" {
repository = local.istio_charts_url
chart = "gateway"
name = "istio-ingress-gateway"
namespace = kubernetes_namespace.istio_system.metadata.0.name
version = ">= 1.12.1"
timeout = 500
cleanup_on_fail = true
force_update = false
depends_on = [helm_release.istiod]
}
We are using helm provider in Terraform to provision istio ingress gateway which in backend use this chart
Below is the terraform code snippet to provision the same. Please help to override the default chart value to create an internal load balancer instead of the default external one. We are aware that it can be done by updating the annotation in the manifest file. But not sure how to do the same in the terraform code snippet?
terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = ">= 1.0.0"
}
}
}
provider "helm" {
kubernetes {
config_path = "${var.kubeconfig_file}"
}
}
resource "helm_release" "istio-ingress" {
repository = local.istio_charts_url
chart = "gateway"
name = "istio-ingress-gateway"
namespace = kubernetes_namespace.istio_system.metadata.0.name
version = ">= 1.12.1"
timeout = 500
cleanup_on_fail = true
force_update = false
depends_on = [helm_release.istiod]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
set
参数块( https://registry.terraform.io/providers/hashicorp/helm/helm/latest/docs/resources/release#set ) href =“ https://registry.terraform.io/providers/hashicorp/helm/latest/docs/Resources/Release#Values” rel =“ noreferrer”> https://registry.terraform.io/providers/hashicorp/helm/latest/latest/docs/docs/resources/release#values )来自原始values.yaml
的默认设置应看起来像:
或
放置一个
custom-values.yaml
您的代码中的文件。本文很好地解释了它:
https://getBetterdevops.io/terraform/terraform-with-helm/
希望这会有所帮助!
You can either use the
set
argument block (https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#set) or thevalues
argument (https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#values) of the resourcehelm_release
to override the default settings from the originalvalues.yaml
Should look something like:
or
and place a
custom-values.yaml
file in your code.This article explains it pretty nicely:
https://getbetterdevops.io/terraform-with-helm/
Hope this helps!