go-api-boilerplate icon indicating copy to clipboard operation
go-api-boilerplate copied to clipboard

terraform apply

Open talpa opened this issue 2 years ago • 2 comments

I tried make terraform-install and result is

cd k8s \
  kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.crds.yaml \
terraform init \
terraform apply \
  terraform output -raw templates | kubectl apply -f -
error: no objects passed to apply
make: *** [Makefile:66: terraform-install] Error 1

when I try command by comand then by kubectl apply is result this...


Error: Post "http://localhost/api/v1/namespaces": dial tcp 127.0.0.1:80: connect: connection refused
│ 
│   with kubernetes_namespace.main,
│   on k8s-namespace.tf line 1, in resource "kubernetes_namespace" "main":
│    1: resource "kubernetes_namespace" "main" {
│ 
╵
╷
│ Error: Post "http://localhost/apis/storage.k8s.io/v1/storageclasses": dial tcp 127.0.0.1:80: connect: connection refused
│ 
│   with kubernetes_storage_class.mongodb,
│   on mongodb.tf line 28, in resource "kubernetes_storage_class" "mongodb":
│   28: resource "kubernetes_storage_class" "mongodb" {

Can you help me? Please

talpa avatar Aug 19 '21 12:08 talpa

it tries to create a volume, make sure that mounted directory exists on the machine

sorry, for the late reply but I just noticed, for some reason I didn't get email about that issue

vardius avatar Aug 28 '21 03:08 vardius

For anyone having this issue. Just set the kube context in the terraform variable file to the context you want to use.

gopherstein avatar Nov 17 '21 23:11 gopherstein