For prerequisites see here.
In this example, we deploy again the Helm chart of the hello-world example and then delete it again whereby we provoke an error by removing the target before.
First create the Target and the Installation again:
-
Insert in file target.yaml the kubeconfig of your target cluster.
-
On the Landscaper resource cluster, create namespace
example
and apply the target.yaml and the installation.yaml:kubectl create ns example kubectl apply -f <path to target.yaml> kubectl apply -f <path to installation.yaml>
In the next step we delete the target my-cluster
:
kubectl delete target -n example my-cluster
Now when we delete the Installation, there is no access information of the target cluster available from where the Helm chart should be removed and therefore the deletion of the Installation fails:
kubectl delete installation -n example hello-world
Now it requires some time until the timeout occurs and the Installation fails, i.e. phase: DeletionFailed
. You could
speed this up by setting the interrupt annotation:
kubectl annotate installation -n example hello-world landscaper.gardener.cloud/operation=interrupt
For prerequisites see.
The usual way to resolve the failed Installation is to recreate the target and re-trigger the deletion of the
installation by setting the reconcile
annotation:
kubectl apply -f <path to target.yaml>
kubectl annotate installation -n example hello-world landscaper.gardener.cloud/operation=reconcile
Now the installation is gone and the deployed Helm chart was uninstalled.
If it is not possible to resolve the problems and it is ok that the deployed Helm chart is not uninstalled, you could use the landscaper-cli to remove the installation. For example, this is the preferred solution if the target cluster does not exist anymore. You achieve this with the following command:
landscaper-cli installations force-delete -n example hello-world
It is not recommended to use this approach, if you have a successful Installation and want to remove it without
uninstalling the deployed components on the target cluster. In such a situation use the annotation
landscaper.gardener.cloud/delete-without-unstall: true
.