Cloning Service Issue

I have an application with service1 and service2 , service1 is linked to service2 with another name.


I have the following issue while upgrading

  1. During an upgrade fail scenario, I cloned service1 to create another service with name service1x
  2. Then removed the service1 and cloned service1x again to create old servicename back(service1)
  3. The above has been done to preserve the name for linking, though linking in service2 got lost in between, I had to upgrade the service2 again with linking to fix it, which is not desirable
  4. Same kind of issue happens with load balancer too, which is horrific. Loadbalancer lost its configuration while recreating the service in above way and had to re add the configuration to load balancer again to fix it

Is there any other solution for this scenario?

Links are to a particular ID and you are removing the service with that ID, so the link is no longer valid. Why are you needing to do 1 & 2 in the first place?

Thanks for the reply Vincent. Because I had to do it in case, upgrade of a particular service fails. So I thought of cloning the service with same name, would preserve the links, but I am wrong. So what is the best solution for this one? I know, using rancher dns service name would be the better way. But I want db to be precreated before web get deployed, thats why I use links, just delay the second container deployment. Also I have so many services in a single catalog, is there any other way to deploy services one by one, instead of pulling all the images at the same time? Would depends_on works?