Clean up orphaned resources
Closed this issue · 2 comments
In #278 vnet peering resource was replaced by vpn gateway in order to connect both host and guest clusters.
Currently the new controller version (1.1.0
) will ensure that vpn gateway is created and connected, but vnet peering created by previous version (1.0.0
) will remain there.
We need to ensure that orphaned vnet peering are cleaned up when migrating from 1.0.0
to 1.1.0
.
How to reproduce:
- create cluster using version
1.0.0
- update cluster to
1.1.0
- updated cluster will have both vpn gateway and vnet peering
There is two parts in this task:
- delete vnetpeering from the host cluster network (covered in #302)
- delete vnetpeering from the guest cluster network
For the guest cluster part, resources are handled via arm_templates. So the easiest solution there would be to switch from Incremental
to Complete
deployment mode, which would take care of cleaning up any resources not specified in the arm_template.
Doing some research I stumbled #236 where arm_template deployment mode was switched from Complete
to Incremental
. This does not seems to be an option then. Will proceed with sdk as for host cluster.
There is now a new resource on called vnetpeeringcleaner
which is in charge of removing both host and guest clusters virtual network peering resource.