Cloning services between stacks

Hi,

What is the best approach to clone/copy a service from one stack to another existing stack. We can take yaml export and import if we are creating new stack. How do we do it on existing stack. It is very difficult to create a same service again on another stack manually with lot of aliases, environment variables.

Please suggest the best approach to do this.

Thanks
Gokul

It sounds as if you want to clone services into the same stack.

Option 1: Clone individual services using the UI
Option 2: Export the yaml, use rancher-compose or our CLI to launch into the same stack by using -p <stackname> to have the services into the same stack. You’d need to update the services name so there is no conflic.t

@denise

I am not looking into same stack. I am using clone option from UI to create it on same stack. I am looking to create a copy of service to another stack.

Example:

Stack1: service1, service2, service3
Stack2: service4,service5, service6 which is running already and I want a copy of service1 from Stack1.

I am aware that we can create new stack from yaml but i wanted to create a copy of service in existing Stack.

Hi,

Any update on this issue?

I understand what you’re trying to do. At this point, what you’re looking to do does not exist through the UI.

You could use the rancher-compose to do what you want. Copy the yaml for the service that you want to copy and then use.

So if you exported service1 from Stack 1, you could run rancher-compose -p Stack2 up and it would place the service in Stack2.

Feel free to add an enhancement request in Github for being able to clone services across stacks in Rancher.