Hello, I’m very new to Consul, but trying to use it to demo service discovery in an Nginx Reverse Proxy running in a Docker environment. The demo is similar to: Service Discovery for NGINX Plus Using Consul APIs, but with updates to the version of Nginx and the latest Hashicorp Consul Docker Container (1.9.4).
The issue I’m encountering is that every service event triggers the service type watch to trigger the sh script twice. I believe this is related too: Reloading Consul re-runs all watch commands every time. #571 which doesn’t look like it is going to get resolved anytime soon. To workaround this, I have removed the watch configuration from the Consul JSON configuration and instead, I load it manually using the “consul watch” command once the container finishes loading. Loading the watch config manually works as expected with the service event only triggering the sh script once per event.
My question is if anyone can explain why my workaround works when the same configuration doesn’t work in the Consul JSON configuration? Thanks.