No. This is not possible. Note that some metrics are dependent on time since start (e.g. memory usage especially when there is a memory leak) or image version (E.g. new bug introduced), which is often a reason for restart.
Also, if you are using deployment, and you do a rolling update, then the replacements will come from a new replicaSet, so even if ReplicaSet supported this, you would still maybe get many time series. If all the replicas are really identical, then maybe you want to aggregate most of the metrics into a single time series for the collection of Pods? You could still keep a few metrics split out to debug load imbalance issues. On Wednesday, September 6, 2017 at 2:06:20 AM UTC-7, sergei.st...@gmail.com wrote: > > Is there any way to create ordinal index of pods in a normal ReplicaSet > similarly to StatefulSet? > From functional point of view this doesn't make much sense. But could be > really useful for our monitoring solution. We use Prometheus that scrapes > metrics from kubernetes cluster and sends it to InfluxDB. Each newly > created pod gets a unique name by adding a random suffix. The problem is > that each time a new pod of the same replica is created, a new time series > is created. This increases the metrics cardinality reducing performance and > increasing memory footprint. It also results in creating each time a new > line in a dashboard instead of continuing the same line. > For example, suppose, we have a ReplicaSet with 2 replicas and each > replica had 5 restarts. This will result in 10 separate time series and 10 > lines in a monitoring dashboard, while with the ordinal index in place, > there will be just 2. > When dealing with very long time intervals, hundred/thousands time series > will be created for the same instance instead of one. > Any suggestions are greatly appreciated -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.