terraform-iaac / terraform-kubernetes-cert-manager

Terraform module for Kubernetes Cert Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong url has been occurred while running terraform apply.

codal-jayesh opened this issue · comments


│ Error: failed to create kubernetes rest client for read of resource: Get "https://localhost/api?timeout=32s": x509: certificate is valid for *.dev.tappy.stage-codal.net, dev.tappy.stage-codal.net, not localhost

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

Working fine in local machine where kubectl, helm, kubectl config and providers are configured.

Not working in jenkins server where only kubectl command is installed.

Hello, terraform providers settings are incorrect

Hello, terraform providers settings are incorrect

Kubernetes and helm resources through terraform are being created.

Just this one throws error

What about kubectl provider ?

jenkins@ip-172-31-11-15:~/workspace/Dev-Terraform-Deployment/infra/terraform-resources/configs$ cat kubernetes.tf | head -n25
provider "helm" {
kubernetes {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
}
experiments {
manifest = true
}
}

provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
}

provider "kubectl" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
}

pls chk above

I cannot understand how it is getting localhost in "https://localhost/api?timeout=32s"?

please try to add this into kubectl provider

provider "kubectl" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
token = data.aws_eks_cluster_auth.eks_cluster.token
load_config_file = false
}

@bohdantverdyi Thank you.

It has been resolved.