So, if we use
kubectl get pods -n namespace.
we can easily view all pods in a particular namespaces.
my question is how can i view pods in a particular namespace which is associated with a particular service.
So, if we use
kubectl get pods -n namespace.
we can easily view all pods in a particular namespaces.
my question is how can i view pods in a particular namespace which is associated with a particular service.
You can use a selector corresponding to the selector that you have declared in your Service
E.g.
kubectl get pods --selector=app=cassandra
corresponds to this example Service
apiVersion: v1
kind: Service
metadata:
name: cassandra-service
spec:
selector:
app: cassandra
# more lines