consul-k8s
consul-k8s copied to clipboard
customize CONSUL_HTTP_ADDR for catalog sync
Please search the existing issues for relevant questions, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing questions.
Question
Please provide as many details as you can, including but not limited to
# kubectl get pod,svc -l app=consul -n consul
NAME READY STATUS RESTARTS AGE
pod/consul-server-0 1/1 Running 0 26s
pod/consul-server-1 1/1 Running 0 99s
pod/consul-server-2 1/1 Running 0 2m26s
pod/consul-sync-catalog-6fc5c4bc66-s2972 1/1 Running 0 6m43s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/consul-dns ClusterIP 172.31.61.228 <none> 53/TCP,53/UDP 257d
service/consul-server ClusterIP None <none> 8500/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP 257d
service/consul-ui ClusterIP 172.31.63.134 <none> 80/TCP 257d
# kubectl get deploy -n consul consul-sync-catalog -o yaml
env:
...
# 这里指定了 consul-sync-catalog 将服务同步给谁
- name: CONSUL_HTTP_ADDR
value: http://consul-server:8500
how set consul-sync-catalog CONSUL_HTTP_ADDR in helm?
Hi @kong62, the CONSUL_HTTP_ADDR environment variable is being set in this template: https://github.com/hashicorp/consul-helm/blob/master/templates/sync-catalog-deployment.yaml#L98. Line 98 is why yours is getting set to http://consul-server:8500, since you don't have clients or tls enabled. Are you looking to customize the value of this variable? That is currently not supported but could be a feature request. Let us know if you have further questions.
- Nitya and @sadjamz
feature request
Closing as this is addressed via https://github.com/hashicorp/consul-k8s/pull/1659 which allows sync catalog to work without clients