У меня есть серверный узел Консул и клиентский узел Консул на двух отдельных серверах. Я хочу, чтобы мой клиент присоединился к кластеру, но я отказался от своего доверенного лица. Я не знаю почему, потому что я установил http_proxy
, https_proxy
и no_proxy
env vars, но это ничего не меняет.
Вот мои 2 файла docker-compose:
Сервер
consul:
image: consul:1.6
container_name: consul
hostname: consul
restart: always
network_mode: host
volumes:
- consuldata:/consul/data
- ./rules/consul.hcl:/consul/rules/consul.hcl
- ./rules/registrator.hcl:/consul/rules/registrator.hcl
- ../my.pem:/etc/ssl/certs/my.pem:ro
environment:
CONSUL_LOCAL_CONFIG: >-
{
"leave_on_terminate": false,
"skip_leave_on_interrupt": true,
"acl": {"enabled": true,"default_policy": "deny","down_policy": "extend-cache","enable_token_persistence": true},
"log_level": "debug",
"ports": {
"https": 8501
},
"key_file": "/etc/ssl/certs/my.pem",
"cert_file": "/etc/ssl/certs/my.pem",
"ca_file": "/etc/ssl/certs/my.pem",
"performance": {
"raft_multiplier": 1
}
}
HOST_IP: ${HOST_IP}
http_proxy: http://user:password@myproxy:3129
https_proxy: http://user:password@myproxy:3129
HTTP_PROXY: http://user:password@myproxy:3129
HTTPS_PROXY: http://user:password@myproxy:3129
no_proxy: "127.0.0.1"
NO_PROXY: "127.0.0.1"
command: "agent -server -client=${HOST_IP} -bind=${HOST_IP} -bootstrap-expect=2 -ui"
Клиент
consul:
image: consul:1.6
container_name: consul
hostname: consul
restart: always
network_mode: host
volumes:
- consuldata:/consul/data
- ./rules/consul.hcl:/consul/rules/consul.hcl
- ./rules/registrator.hcl:/consul/rules/registrator.hcl
- ../my.pem:/etc/ssl/certs/my.pem:ro
environment:
CONSUL_LOCAL_CONFIG: >-
{
"leave_on_terminate": true,
"skip_leave_on_interrupt": true,
"acl": {"enabled": true,"default_policy": "deny","down_policy": "extend-cache","enable_token_persistence": true},
"log_level": "trace",
"ports": {
"https": 8501
},
"key_file": "/etc/ssl/certs/my.pem",
"cert_file": "/etc/ssl/certs/my.pem",
"ca_file": "/etc/ssl/certs/my.pem",
"performance": {
"raft_multiplier": 1
}
}
HOST_IP: ${HOST_IP}
http_proxy: http://user:password@myproxy:3129
https_proxy: http://user:password@myproxy:3129
HTTP_PROXY: http://user:password@myproxy:3129
HTTPS_PROXY: http://user:password@myproxy:3129
no_proxy: "127.0.0.1,${SERVER_IP},consul-dev.intra.net"
NO_PROXY: "127.0.0.1,${SERVER_IP},consul-dev.intra.net"
command: "agent -bind=${HOST_IP} -client=${HOST_IP} -retry-join=${SERVER_IP}"
В чем я не прав?
Спасибо.