Thanks, guys. I had an issue on github about this( https://github.com/ServiceComb/go-chassis/issues/213#issuecomment-392232430), there is a new doc PR merged telling some details about the configs. According to the new docs(it's in Chinese but I'll try to explain it in English here), the --advertiseAddress is a 'broadcast' address, which I understand is somewhere the current service can 'listen on', so a domain name might not be proper here by the design. The solution for a container environment is to comment the --advertiseAddress, and set --listenAddress to be '0.0.0.0:8080', then go-chassis will detect the current IP and assign it to --advertiseAddress. This makes sense because the address in a container is dynamically allocated. I tried this and it works.
2018-05-25 14:09 GMT+08:00 Jean-Baptiste Onofré <[email protected]>: > Hi, > > that's interesting but maybe it's worth to have more generic that can > support K8 or other options (etcd, DNS, ...). > > My $0.01 > > Regards > JB > > On 25/05/2018 03:51, Lance Ju wrote: > > Hi, gang! > > I'm recently considering migrate my ServiceComb project into > > Kubernetes. To minimize the complexity, I just first try the go-bmi > project( > > https://github.com/ServiceComb-samples/go-bmi), which contains only 2 > > services: the web-app service, which calls the calculator service. > > > > To let the web-app service know how to access calculator service, > there > > is an --advertiseAddress parameter in calculator's chassis.yaml, which > is ' > > 0.0.0.0:8080' by default in the local machine. But for k8s cluster, > > services are usually accessed by DNS(commonly the service name plus the > > namespace), but the go-chassis SDK would only allow CIDR format IP > address > > for the --advertiseAddress, then the calculator service cannot be > > registered in the service center. > > > > So I got 2 questions: > > 1. Does it make sense to allow only CIDR IP addresses when > > registering services? Since the service center only store the 'accessible > > address', which might also be a domain name or IPv6 address(or even Unix > > socket under some particular situation). > > 2. If I'm running ServiceComb projects under bare metals or VMs, > should > > I first know which address of the current service, then config it in > > chassis.yaml? Or is it possible to let the chassis detect the address, > > automatically? > > > > Looking forward to your replies. > > > > -- > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com >
