krumIO / krum-appdev-platform-starter

2 stars 7 forks source link

Terraform Destroy fails regularly for longhorn #11

Open krumware opened 6 months ago

krumware commented 6 months ago

the longhorn teardown looks like it has some potential helm lifecycle issues related to the hooks. It also could be an ordering issue? In general, the 5min deadline is being exceeded.

╷
│ Error: context deadline exceeded
│
│
╵
╷
│ Error: warning: Hook pre-delete longhorn/templates/uninstall-job.yaml failed: 1 error occurred:
│       * jobs.batch "longhorn-uninstall" is forbidden: unable to create new content in namespace longhorn-system because it is being terminated
│
│
│
│
╵
╷
│ Error: uninstallation completed with 1 error(s): context deadline exceeded
│
│
╵
swaphb commented 5 months ago

Removing the longhorn resources from the terraform state file will allow for the cluster to be removed without terraform trying to uninstall the helm resource prior to cluster deletion. This can be done with the following commands:

terraform state rm module.civo-cloud-native.module.longhorn.helm_release.longhorn
terraform state rm module.civo-cloud-native.module.longhorn.kubernetes_namespace.longhorn
terraform destroy