Statefulsets direct kubectl/kubernetes to create pods with an index or ordinal following the pod name. If the entity has a name of redis for example and the replication count is 3, then we will get redis-0, redis-1 and redis-2. Is there some way to get access to the index or ordinal? It would be very useful to pass to the startup script for a container. It would be nice if it were available in the downward api. It would be really really nice to use it when trying to line up PVC's to PV's.
Is it possible that there is some secret template variable for this?
Note that I have found a way around it. I am using a script for my command and use the hostname to extract it. But it just seems like a lot of work (and future maintenance).