We have created a statefulset & headless service. There are 2 ways by which we can define peer ips in application:
- Use 'cassandra-headless-service-name' in contactPoints
- Fetch the peers ip from headless-service & externalize the peers ip and read these ips when initializing the connection. SO far so good. Above will work if one/some pods are restarted, not all. In this case, driver will updated the new ips automatically.
But, how this will work in case of complete outage ? If all pods are down & when they come back, if all pods ip are changed (IP can change in Kubernetes), how do application will connect to Cassandra?