How to identify Kubernetes Active Replica Pod Name

12/12/2018

I have created a kubernetes service name is test-backend and set is replicas: 3 so It will create 3 podname such as

test-backend-deployment-664c7d6f7f-4tnhc    1/1       Running   0          1h
test-backend-deployment-664c7d6f7f-595dc    1/1       Running   0          1h
test-backend-deployment-664c7d6f7f-dndlt    1/1       Running   0          1h

So how I can identify which pod is active currently ? because If I try each one like :
kubectl logs test-backend-deployment-664c7d6f7f-4tnhc then I can identify which is active so Question is there is another way we can identify ?

-- Anupam Somani
kubectl
kubernetes

2 Answers

12/13/2018

I just want to verify which is the current pods is serving so I identify that hostname is same as podname. Thanks I got the solution.

-- Anupam Somani
Source: StackOverflow

12/13/2018

Unless i'm misunderstanding your question, all three pods are active. The service will round robin requests to all 3 instances (by default).

-- N. Alston
Source: StackOverflow