1

我正在尝试通过 terraform 设置 helm 和 helm 版本,根据terraform plan

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # helm_release.prometheus_vsi will be created
  + resource "helm_release" "prometheus_vsi" {
      + chart            = "stable/prometheus"
      + disable_webhooks = false
      + force_update     = false
      + id               = (known after apply)
      + metadata         = (known after apply)
      + name             = "prometheus-vsi"
      + namespace        = "prometheus"
      + recreate_pods    = false
      + repository       = "stable"
      + reuse            = false
      + reuse_values     = false
      + status           = "DEPLOYED"
      + timeout          = 300
      + values           = [
          + <<~EOT
                rbac:
                  create: true
                   enabled: false
            EOT,
        ]
      + verify           = false
      + version          = "10.2.0"
      + wait             = true
    }

Plan: 1 to add, 0 to change, 0 to destroy.

但是当我运行terraform apply“恐慌输出”中提到的抛出错误时。

地形版本

Terraform v0.12.18 + provider.aws v2.43.0 + provider.helm v0.10.4 + provider.kubernetes v1.10.0 + provider.local v1.4.0 + provider.null v2.1.2 + provider.random v2.2.1 + provider.template v2.1.2

您的 Terraform 版本已过时!最新版本是 0.12.19。您可以从https://www.terraform.io/downloads.html下载更新

受影响的资源

  • helm_release

Terraform 配置文件

provider "helm" {
  version         = "~> 0.10"
  install_tiller  = true
  service_account = local.helm_service_account_name
  debug           = true
  kubernetes {
    config_path = "${path.module}/kubeconfig_${module.eks.kubeconfig}"
  }
}
data "helm_repository" "stable" {
  name = "stable"
  url  = "https://kubernetes-charts.storage.googleapis.com"
}

resource "helm_release" "prometheus_vsi" {
  name       = "prometheus-vsi"
  repository = data.helm_repository.stable.metadata[0].name
  chart      = "stable/prometheus"
  namespace  = local.prometheus_ns
  version    = "10.2.0"
  values = [
    "${file("${local.chart_root}/prometheus/prometheus-values.yaml")}"
  ]
}

调试输出

我已经启用debug=true但它不产生掌舵特定日志

恐慌输出

Error: error installing: the server could not find the requested resource (post deployments.apps)

  on main.tf line 205, in resource "helm_release" "prometheus_vsi":
 205: resource "helm_release" "prometheus_vsi" {

预期行为

根据terraform plan它应该helm_release在 Kubernetes 中创建。

实际行为

Terraform 应用抛出错误。

重现步骤

  1. terraform apply

谢谢。

4

1 回答 1

0

稳定回购已弃用,所有图表已于 2020 年 11 月删除。

试试图表:prometheus-community/kube-prometheus-stack

网址:https ://prometheus-community.github.io/helm-charts

于 2021-01-09T09:28:40.080 回答