terraform-iaac / terraform-kubernetes-cert-manager

Terraform module for Kubernetes Cert Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation error trying to acess namespaces endpoint

stevenbarragan opened this issue · comments

I'm getting this error after trying to set it up

│ Error: Post "http://localhost/api/v1/namespaces": dial tcp [::1]:80: connect: connection refused

│ with module.cert_manager.kubernetes_namespace.cert_manager[0],
│ on .terraform/modules/cert_manager/main.tf line 1, in resource "kubernetes_namespace" "cert_manager":
│ 1: resource "kubernetes_namespace" "cert_manager" {

my tf files look like

module "cert_manager" {
  source = "terraform-iaac/cert-manager/kubernetes"

  cluster_issuer_email = "email@example.com"

	certificates = {
		"example-cert" = {
			dns_names = ["example.com", "*.example.com"]
		}
	}
}

resource "helm_release" "ingress-nginx" {
  name             = "ingress-nginx"

  repository       = "https://kubernetes.github.io/ingress-nginx"
  chart            = "ingress-nginx"

  create_namespace = true
  namespace       = "gitlab-managed-apps"


  set {
    name  = "controller.annotations.cert-manager\\.io/cluster-issuer"
    value = module.cert_manager.cluster_issuer_name
  }
}

Am I missing anything?

Hello, @stevenbarragan
Looks like your kubernetes terraform provider configuration is wrong.

In fact I didn't have a kubernetes provider setup directly. I've been using the helm provider so far. Setting a standalone kubernetes provider fixed the issue.

Thanks @bohdantverdyi