Why those services still exist in node k8s-sync after set connectInject.enable=false?

Hello, I practice consul in my k8s single node cluster.
At first, I try to change 2 variables in the consul-0.38.0/values.yaml
‘connectInject.enable=true’ and ‘syncCatalog.enable=true’, then those services are showed in a new node - k8s-sync.

Now I undo the changes, set ‘connectInject.enable=false’ and ‘syncCatalog.enable=false’, and helm regrade again.
But Consul UI still has k8s-sync, and those services and node don’t be deregistered.

How to deregister resources after connectInject is false?

Hi @chiyt27,

Synced services are not automatically removed from Consul when syncCatalog.enable is changed from true to false.

You will need to manually deregister the k8s-sync node from Consul’s service catalog using the /v1/catalog/deregister API endpoint in order to remove the associated services.

For example:

$ curl --request PUT $CONSUL_HTTP_ADDR/v1/catalog/deregister --data '{"Node": "k8s-sync"}'
1 Like