Skip to content
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

Disabling or removing 'consul.hashicorp.com/service-sync' annotation does nothing #76

Closed
BarthV opened this issue Mar 2, 2019 · 1 comment · Fixed by #153
Closed
Labels
area/sync Related to catalog sync type/bug Something isn't working

Comments

@BarthV
Copy link

BarthV commented Mar 2, 2019

What i'm trying to do

  • Consul-k8s is running with -k8s-default-sync=false
  • Starting with a synced service :
apiVersion: v1
kind: Service
metadata:
  annotations:
    consul.hashicorp.com/service-meta-OWNER: foobar
    consul.hashicorp.com/service-name: my-kubernetes-hosted-svc
    consul.hashicorp.com/service-sync: "true"
    consul.hashicorp.com/service-tags: foo,bar
[...]

What is the problem

When we set consul.hashicorp.com/service-sync to "false" or if we remove it (using kubectl edit) :

  • Consul-k8s does nothing
  • Service is still synchronized

What it should be doing (IMO)

  • Removing all registered instances for this service when we remove (or disable) this annotation

The only way I find to do so is to delete this service and create it again without this annotation.

Did I missed something or is it the intended behavior ?
Thx a lot :) !

@adilyse adilyse added the type/bug Something isn't working label Mar 5, 2019
@adilyse
Copy link
Contributor

adilyse commented Mar 5, 2019

Hi @BarthV,

That's a great find! I tried this with debug logging on and we definitely seem to have a bug in our sync code. I get these conflicting log messages when changing the sync annotation to false:

2019-03-05T18:17:50.733Z [DEBUG] to-consul/source: syncing disabled for service, ignoring: key=default/counting
2019-03-05T18:18:14.075Z [DEBUG] to-consul/sink: registered service instance: node-name=k8s-sync service-name=counting
2019-03-05T18:18:14.081Z [DEBUG] to-consul/sink: registered service instance: node-name=k8s-sync service-name=counting

I'll add this to our backlog. Thanks for reporting it!

@lkysow lkysow added the area/sync Related to catalog sync label Sep 19, 2019
lkysow added a commit that referenced this issue Oct 11, 2019
Previously, if consul.hashicorp.com/service-sync was set to true and
then set to false, the service wouldn't get deleted.

Fixes #76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync Related to catalog sync type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants