k8s running on Azure (AKS) - created with terraform,
Consul cluster external to k8s,
consul-k8s deployment (not helm chart, without installing any consul agent or server on the k8s side),
properly annotated k8s services are synchronized to consul (default synchronization set to false)
Everything works as expected, but there is a catch in case of terraform destroy on k8s cluster - services are left on consul and because they are external services - no healthcheck is possible so consul continue to serve their addresses in service discovery as healthy.
Is there any way to automatically deregister services from consul in case the k8s cluster is “terraform destroyed” ?
Regards and you all at HashiCorp keep doing the great work