Using StackName in catalogs

Trying to use the stack name / service in a custom catalog.

The stack name is input from the catalog page.

io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=${stack_name}/${service_name}

How do i go about pulling in the stack name and service into the yml files?

the ${stack_name}/${service_name} are understood by Rancher when making scheduling decisions. You’ll need to escape them with a $ so, $${stack_name}/$${service_name}

If you want them from inside the container while running, then you just need to query metadata:

http://rancher-metadata/2015-19-12/self/service/name
http://rancher-metadata/2015-19-12/self/stack/name

from inside the container.