Due to the ephemeral nature of Pods, the IP addresses for Pods running a particular service (such as Elasticsearch) may change. For instance, the scheduler may kill Pods running on a busy node, and redeploy it on a more available node.
This poses a problem for our Elasticsearch deployment because:
- An Elasticsearch instance running on one Pod would not know the IP addresses of other instances running on other Pods
- Even if an instance obtains a list of IP addresses of other instances, this list will quickly become obsolete
This means that Elasticsearch nodes cannot discover each other (this process is called Node Discovery), and is the reason why changes applied to one Elasticsearch node is not propagated to the others.
To resolve this issue, we must understand how Node Discovery works in Elasticsearch, and then figure out how we can configure Kubernetes to enable discovery for Elasticsearch.