Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to delete an object before inserting? #60

Open
marcellodesales opened this issue Oct 27, 2020 · 0 comments
Open

how to delete an object before inserting? #60

marcellodesales opened this issue Oct 27, 2020 · 0 comments

Comments

@marcellodesales
Copy link

marcellodesales commented Oct 27, 2020

Describe the bug

  • Re-running terraform apply fails with the following:
Error: customresourcedefinitions.apiextensions.k8s.io "targetgroupbindings.elbv2.k8s.aws" already exists
  on k8s_system_load_balancer_controller_install.tf line 37, in resource "k8s_manifest" "load_balancer_controller_crds":
  37: resource "k8s_manifest" "load_balancer_controller_crds" {

Steps to reproduce the issue:

  • Get an object for applying
data "http" "load_balancer_controller_crds" {
  url = "https://github.com/aws/eks-charts/raw/master/stable/aws-load-balancer-controller/crds/crds.yaml"
}

resource "k8s_manifest" "load_balancer_controller_crds" {
  content   = data.http.load_balancer_controller_crds.body
  namespace = kubernetes_service_account.load_balancer_controller.metadata.0.namespace
}

Expected behavior

  • Maybe execute kubectl delete before doing kubectl apply?
    • To update I usually do
curl -o https://......./crd.yaml URL && \
    kubectl delete -f crd.yaml  && \
    kubectl apply -f crd.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant