clarify the use of Consul Naming Resolution - The HOST_ADDRESS and DAPR_HTTP_PORT
Q: How to set value of HOST_ADDRESS, DAPR_HTTP_PORT... in this setting? I read it, but, I don't know about HOST_ADDRESS mean? It is k8s service name or something?
A: From Yaron2 - That's the address for the Consul agent to discover the Dapr sidecar on. If the Agent is on the same machine/pod, it should be localhost, for example. If on another node, it should be the "
Perhaps we could flesh out this page in the docs more - https://docs.dapr.io/reference/environment/
As there are different uses of environment variables in the runtime it can be a bit confusing at times for users to identify those variables that are either:
a) Set by the runtime and/or driven via the CLI arguments - (e.g. HOST_ADDRESS, DAPR_HTTP_PORT) b) Exposed to the user as a mechanism to override some configuration - (e.g. DAPR_HOST_IP)
I agree with you about this docs. In my case, I deployed in k8s cluster, and don't know how about HOST_ADDRESS setting. From doc guides for config name resolution using Consul,I don't know about HOST_ADDRESS of service in my cluster. I tried to set annotations dapr.io/env: HOST_ADDRESS=service-name but it is not work. Consul show address can't resolve while check service health. With answer from Yaron2, I tried to set check url to <app-name>-dapr service name, but Consul show same error. In my kubectl get service show, counting-service is my app name:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
counting-service-dapr ClusterIP None <none> 80/TCP,50001/TCP,50002/TCP,9090/TCP 2d23h