How two kubernetes pods can communicate?


I have created 2 PODS. In one POD I have kept all the machine learning model pickle file and in another one I have kept flask api code( How flaskapi POD will communicate with mlPickleFile POD?

-- Saurabh Kumar

1 Answer


There are two ways the pods can communicate with each other.

1. Shared Storage

The pod configuration allows specifying shared storage volumes. There are multiple options for shared volumes in Kubernetes. Each has its own behavior and working configuration. However it is less likely in your use case that you should create a shared volume and share information with eachother.

2. Pod Networking

The pods are available for each other via network. The network configuration depends on how you create your pods. In the most simplistic configuration, the pods are configured to be operated in a virtual local network. All the pods are operated in the same subnet in the cluster in this config. One pod can be reached out by anothers via its cluster ip or cluster dns entry which exposes your pod under a service name.

For example -

The application X, if creates the service service-x, it is available for all other pods by:


inside the cluster.

-- Charlie
Source: StackOverflow