Skip to content

Commit

Permalink
Merge pull request #1025 from weaveworks/3152-document-resource-delet…
Browse files Browse the repository at this point in the history
…ion-workaround

docs: Document a fix to "terraform objects stuck on deletion" issue
  • Loading branch information
yitsushi authored Oct 12, 2023
2 parents 60f79e7 + aebc32b commit 89e0c7e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/how_to/resource_deletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@ However, if the source object is unavailable or has been deleted, the re-plannin
As a result, the Terraform Controller cannot locate the resource state,
leading to an infinite deletion attempt cycle, commonly known as a looping process.

If the source object was deleted and the deletion of a Terraform resource is
stuck, clearing the `finalizers` let the system delete the resource skipping
the finalizer of the Terraform Controller.

1. Suspend the `kustomization`:
```
flux suspend kustomization tf-stk
```
2. Patch the Terraform resource:
```
kubectl patch terraforms.infra.contrib.fluxcd.io \
-n stk helloworld \
-p '{"metadata":{"finalizers":null}}' \
--type=merge
```

As it skips the finalizer of the Terraform controller, any cleanup the
controller would do will be skipped too.

## Role Bindings

Role bindings assign permissions to Terraform runners, allowing them to execute operations within the Kubernetes cluster.
Expand Down

0 comments on commit 89e0c7e

Please sign in to comment.