Why may be the reason fo helm_resource in terraform script being terribly slow?

4/14/2020

I've a terraform script for my AWS EKS cluster and the following pieces there:

provider "helm" {
  alias = "helm"
  debug = true
  kubernetes {
    host                   = module.eks.endpoint
    cluster_ca_certificate = module.eks.ca_certificate
    token                  = data.aws_eks_cluster_auth.cluster.token
    load_config_file       = false
  }
}

and:

resource "helm_release" "prometheus_operator" {
  provider   = "helm"
  depends_on = [
    module.eks.aws_eks_auth
  ]
  chart      = "stable/prometheus-operator"
  name       = "prometheus-operator"
  values     = [
    file("staging/prometheus-operator-values.yaml")
  ]
  wait       = false
  version    = "8.12.12"
}

With this setup it takes ~15 minutes to install the required chart with terraform apply and sometimes it fails (with helm ls giving pending-install status). On the other hand if use the following command:

helm install prometheus-operator stable/prometheus-operator -f staging/prometheus-operator-values.yaml --version 8.12.12 --debug

the required chart gets installed in ~3 minutes and never fails. What is the reason for this behavior?

EDIT

Here is a log file from a failed installation. It's quit big - 5.6M. What bothers me a bit is located in line no 47725 and 56045

What's more, helm status prometheus-operator gives valid output (as if it was successfully installed), however there're no pods defined.

EDIT 2

I've also raised an issue.

-- Opal
amazon
amazon-eks
kubernetes
kubernetes-helm
terraform

0 Answers