I tried to follow the guide below to enable multi-host networking on my UCP cluster:
As described in the document, I added the following startup options to the docker daemon for connecting to the KV store:
–cluster-advertise em2:12376 --cluster-store etcd://ucp.skywidesoft.com:12379 --cluster-store-opt kv.cacertfile=/var/lib/docker/discovery_certs/ca.pem --cluster-store-opt kv.certfile=/var/lib/docker/discovery_certs/cert.pem --cluster-store-opt kv.keyfile=/var/lib/docker/discovery_certs/key.pem
However, I found that only engine nodes will works. On UCP controller, it will cause the following error:
Registering as “126.96.36.199:12376” in discovery failed: client: etcd cluster is unavailable or mis-configured.
After some researching and study the document about the certs that will be created by UCP, I found that in UCP controller, I need to change the cert location to use the certs and key files from the volume “ucp-swarm-node-certs”. I change the docker engine startup options as follows:
–cluster-advertise em2:12376 --cluster-store etcd://ucp.skywidesoft.com:12379 --cluster-store-opt kv.cacertfile=/var/lib/docker/ucp_discovery_certs/ca.pem --cluster-store-opt kv.certfile=/var/lib/docker/ucp_discovery_certs/cert.pem --cluster-store-opt kv.keyfile=/var/lib/docker/ucp_discovery_certs/key.pem
Note: I manually created the folder /var/lib/docker/ucp_discovery_certs and copy the files from ucp-swarm-node-certs into it.
After I did that, restart docker daemon, then I can successfully connect the docker to the UCP KV store container on the UCP controller without errors, and can create overlay network.
Any comments are welcome