Which shows that the CONSUL_ADDRESS is being modified to use the consul-server service by default and not the host_ip.
As a result my deployment is failing to connect to the consul agent. I checked the release notes and documentation for Consul Helm but did not find anything that allows me to update the environment variables in Catalog Sync.
I also tried deploying a server service but it clearly stated that NODE_IP should be used instead of the service:
+ # Source: consul/templates/server-service.yaml
+ # Headless service for Consul server DNS entries. This service should only
+ # point to Consul servers. For access to an agent, one should assume that
+ # the agent is installed locally on the node and the NODE_IP should be used.
+ # If the node can't run a Consul agent, then this service can be used to
+ # communicate directly to a server agent.
Consul-K8S 1.0.0 introduces Consul Dataplane, and Consul Clients are no longer deployed by default. You can find these changes listed under Breaking Changes in the release notes.
I was running 0.49.6 with no issues and all I did was update the chart version to 1.0.0. To make sure no new features are enabled I also updated my Values.yaml as follows
I am installing the Consul agent manually on the nodes so there is no need to enable the client or install the agent through the chart.
On applying the new chart I get the following error from the pods:
consul-server-connection-manager: trying to connect to a Consul server
2023-05-25T12:45:09.254Z [ERROR] consul-server-connection-manager: connection error: error="failed to discover Consul server addresses: failed to resolve DNS name: consul-catalog-sync-consul-server.infra-system.svc: lookup consul-catalog-sync-consul-server.infra-system.svc on 172.20.0.10:53: no such host"
2023-05-25T12:45:09.649Z [INFO] consul-server-connection-manager: trying to connect to a Consul server
2023-05-25T12:45:09.661Z [ERROR] consul-server-connection-manager: connection error: error="failed to discover Consul server addresses: failed to resolve DNS name: consul-catalog-sync-consul-server.infra-system.svc: lookup consul-catalog-sync-consul-server.infra-system.svc on 172.20.0.10:53: no such host"
2023-05-25T12:45:10.468Z [INFO] consul-server-connection-manager: trying to connect to a Consul server
2023-05-25T12:45:10.474Z [ERROR] consul-server-connection-manager: connection error: error="failed to discover Consul server addresses: failed to resolve DNS name: consul-catalog-sync-consul-server.infra-system.svc: lookup consul-catalog-sync-consul-server.infra-system.svc on 172.20.0.10:53: no such host"
This is interesting; why would you not use the Helm option to install Consul Clients?
Regardless, this scenario is similar to having servers external to Kubernetes, and you can use the externalServers Helm option so that the syncCatalog pods would use them.