How to get an index of a Pod of a Replication Controller?

3/23/2016

I have a Replication Controller whose size is more than one, and I'd like to embed the application monitoring profiler in only a pod in the replication controller. So I want the index or something to determine the pod is chosen only one. Especially in the GKE environment, is there such information?

-- yanana
google-kubernetes-engine
kubernetes

2 Answers

3/24/2016

You will be interested in the parametrized set/templating proposal that will allow you to define indices https://github.com/kubernetes/kubernetes/blob/release-1.2/docs/proposals/templates.md. This will most likely be included in 1.3.

-- Prashanth B
Source: StackOverflow

3/23/2016

Pods started by a replication controller are all treated identically; they don't have any sort of ordinality.

If you want to start a group of identical pods and enable an extra feature in just one of them, you should consider using a master election scheme and having just the elected master run the monitoring profiler.

-- Robert Bailey
Source: StackOverflow