Closed kong62 closed 3 years ago
Hi @kong62, the workflow you describe:
k8s cluster 01 ----> consul-sync 1 ----
|
----> consul
|
k8s cluster 02 ----> consul-sync 2 ----
is unfortunately not supported at this time. The behaviour you are seeing is because each syncer is trying to delete the services that the other syncer has synced. Each syncer is programmed to keep a list of services it has synced, and will delete anything not synced by it.
If you would like services in multiple clusters synced to Consul, you could consider using Consul Service mesh, and using Federation between Kubernetes Clusters to have all of the services registered in Consul.
@ndhanushkodi slaved, thanks
cluster01:
-consul-node-name=k8s-sync-cluster01 \
-consul-k8s-tag=cluster01 \
cluster02:
-consul-node-name=k8s-sync-cluster02 \
-consul-k8s-tag=cluster02 \
Hi, @ndhanushkodi - is that way - described by @kong62 - of differentiating k8s clusters by -consul-k8s-tag a supported way of syncing services from multiple k8s clusters to single consul datacenter? Can we use it and be sure it won't stop working (being "fixed" as a bug) in some future version?
If solving similar cases by appropriate tagging is not really taking advantage of a "bug" - could it be described in docs?
Hi @bondido, yes that's the expected way. It won't be removed later. I can open up a ticket to document this better but if you'd like to submit a documentation PR yourself the page is here: https://github.com/hashicorp/consul/blob/main/website/content/docs/k8s/service-sync.mdx
Community Note
Overview of the Issue
Reproduction Steps
Logs
cluster 01:
cluster 02:
Expected behavior
Environment details
consul-k8s
version: hashicorp/consul-k8s:0.26.0consul-helm
version: 0.32.1cluster01: helm deploy consul and consul-sync
values.yaml
used to deploy the helm chart:cluster02: deploy consul-sync only by k8s deployment
Additional Context
service instances very unstable :
this is my want: