Scale number from container

Hi all, there is a way to get the scale number from a container?
For example I scale 3 times my container "my_app"
and in the container “my_app_1” recover the number 1, in the container my_app_2 recover the number 2 etc.

I hope I am clear :confused:

@kevinliteon you can use rancher-metadata service where the information about rancher services/containers is stored. So from inside your container, you execute:

curl rancher-metadata/latest/self/container/service_index

where service_index would be “1” for my_app_1, “2” for my_app_2, etc

1 Like

great ! thank you :slight_smile: