ticha2017
ticha2017

Reputation: 1

Pods in a kubernetes

Please can someone through more light on this questions

Q.1 In a Kubernetes cluster, will pods communicate with each other without configuring a service? Q.2 In a kubernetes cluster how do we configure pods so they don't communicate with each other

Thanks

I'm still a starter.

Upvotes: -1

Views: 45

Answers (1)

P Ekambaram
P Ekambaram

Reputation: 17689

Find below answers to your queries

Q.1 In a Kubernetes cluster, will pods communicate with each other without configuring a service? Ans: In Kubernetes, each Pod gets an IP address. A Pod can communicate with another Pod by directly addressing its IP address. Pods are scaled out and scaled down so, it is not advisable to rely on pod ip address. but the recommended way is to use Services. A Service is a set of Pods, which can be reached by a single, fixed DNS name or IP address.

Q.2 In a kubernetes cluster how do we configure pods so they don't communicate with each other Ans: By default, all pods can talk to all pods with no restriction. NetworkPolicy resource allows us to restrict the ingress and egress traffic to/from pods.

Upvotes: 1

Related Questions