-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete services synced to external Consul server when running helm delete #156
Comments
Hi @jasonliu747 I think this was fixed by #153 however we haven't got a release out yet. We'll get on that ASAP. (possible duplicate of #76) |
FYI, if the helm release was deleted, services didn't deregister either. Cheers! |
@jasonliu747 can you test with the latest version (v0.9.4) please. I'm not sure what you mean by deleting the helm release? Do you mean Consul or a service you're syncing into Consul that is also managed by helm? |
For example, I have three local VMs as consul server. And deploy consul clients(server disabled in values.yaml) in K8S using helm. Latest version did fix #76. But when I executed |
Okay I understand. That's expected behaviour. When the sync catalog exits, it doesn't delete services. If it did, then when you did a deploy of it or its Pod died, your services would be deleted. |
But when someone deletes consul from K8S using |
Yes, they might expect that. We could build it using a helm hook I suppose. If that's what you're asking for I'll reword this issue. |
Awesome buddy. Thanks for ur hard working. |
@lkysow is there a manual way to clear services registered through this or is my best bet to delete consul and try again? |
Hi, you can use the Consul HTTP API to delete services. |
@lkysow that doesn't seem to work. A quick google told me that I have to fetch a service ID in order to unregister the service. At least that is what I am hoping you suggested. So I tried it on a test setup, I had previously "synced" the cURL:
When I use either of the
Any clue which API to use to clean this up? |
Hey I think you need to use the catalog deregister endpoints. Not the agent endpoints. Sorry for not being exact, I'm not at my laptop. |
Thank you, much appreciated! :) So for the record, or for anyone looking to delete all of what the catalog sync added:
|
Edited by @lkysow: After investigation, this request is about deleting services synced from Kubernetes to an external Consul server when the Consul helm release is deleted. This only applies for external Consul servers because if they were being deployed on Kubernetes, they would be deleted when
helm delete
is run.The service synced to consul by annotation won't deregister after the service is deleted. And won't deregister after changing its annotation toconsul.hashicorp.com/service-sync: "false"
either.Here is my values.yaml
The text was updated successfully, but these errors were encountered: