Anupam Somani
Anupam Somani

Reputation: 224

How to identify Kubernetes Active Replica Pod Name

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 ?

Upvotes: 0

Views: 325

Answers (2)

Anupam Somani
Anupam Somani

Reputation: 224

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.

Upvotes: 0

N. Alston
N. Alston

Reputation: 61

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

Upvotes: 2

Related Questions