gitops-bridge-dev/gitops-bridge-argocd-bootstrap-terraform

Error applying several bootstraps with terraform

Closed this issue · 4 comments

While working with the cluster, sometimes, Terraform is not able to apply the manifest due to fetch error:

│ Error: argocd/bootstrap-addons failed to fetch resource from kubernetes: the server could not find the requested resource
│ 
│   with module.eks_cluster.module.gitops_bridge_bootstrap.kubectl_manifest.bootstrap["addons"],
│   on .terraform/modules/eks_cluster.gitops_bridge_bootstrap/main.tf line 93, in resource "kubectl_manifest" "bootstrap":
│   93: resource "kubectl_manifest" "bootstrap" {
│ 

This seems to be related to gavinbunney/terraform-provider-kubectl#270

One of the suggested workaround, is to relay on a raw helm chart to apply the manifest

User Alekc has forked the gavinbunney in version 1.14 and has made some fixes on it here : https://github.com/alekc/terraform-provider-kubectl

A Quick fix, is to change the provider to uses a maintained fork of the kubectl provider :

before:
    kubectl = {
      source  = "gavinbunney/kubectl"
      version = ">= 1.14"
    }
after:
    kubectl = {
      source  = "alekc/kubectl"
      version = ">= 2.0.2"
    }

In fact the error is still there.

To repdocude, I delete the application and try try again

argocd appset delete argocd/bootstrap-workloads -y
argocd appset delete argocd/bootstrap-addons -y

This is resolved with the uses of helm instead of kubectl

Fix in #6