Closed lin-crl closed 4 months ago
We are hitting the following issue on hashicorp/helm TF provider where if wait is enabled, it doesn't execute the post install hooks for the helm release. https://github.com/hashicorp/terraform-provider-helm/issues/683
You can use following terraform script to avoid this issue. You just need to add wait = false
in the TF code.
terraform {
required_version = ">=1.0"
required_providers {
helm = {
source = "hashicorp/helm"
version = "=2.14.0"
}
}
}
provider "helm" {
debug = true
kubernetes {
config_path = "~/.kube/config"
}
}
resource "helm_release" "cockroachdb" {
name = "cockroachdb"
repository = "https://charts.cockroachdb.com/"
chart = "cockroachdb"
wait = false
values = [
file("${path.module}/cockroachdb-values.yaml")
]
}
@prafull01 appreciate your help. I confirm the workaround above worked. We can close this issue.
Describe the problem
When using TF Helm provider to deploy CRDB on AKS, the init job doesn't seem to get started, and cluster cannot be created. When using Helm commands directly on the same AKS cluster with the same cockroachdb-values.yaml, however the cluster is deployed successfully.
To Reproduce Steps to reproduce the behavior:
Set up an AKS cluster Feel free to refer to here to create a test cluster
Use TF & Helm provider to deploy CRDB create a terraform file as such
here's the custom cockroachdb-values.yaml
Look at kubernetes pods, there's no init job pod. This can be verified in Azure UI as well
See error in
kubectl logs cockroachdb-0
I also used dnsutils and it show the host name can be resolved.
Name: cockroachdb-1.cockroachdb.default.svc.cluster.local Address: 192.168.10.15
helm_release.cockroachdb: Still creating... [5m0s elapsed] helm_release.cockroachdb: Still creating... [5m10s elapsed] ╷ │ Warning: Helm release "cockroachdb" was created but has a failed status. Use the
helm
command to investigate the error, correct it, then run Terraform again. │ │ with helm_release.cockroachdb, │ on cockroachdb.tf line 22, in resource "helm_release" "cockroachdb": │ 22: resource "helm_release" "cockroachdb" { │ ╵ ╷ │ Error: context deadline exceeded │ │ with helm_release.cockroachdb, │ on cockroachdb.tf line 22, in resource "helm_release" "cockroachdb": │ 22: resource "helm_release" "cockroachdb" { │