I have created stateful service which is backed by a postgres deployment with k8s.
Setup is 3 public subnet|AZ and 3 private subnet|AZ. postgres deployment is in place to create 1 replica and Service with
But now every time I delete the service and create again IP is changing and I was reading something about DNS resolution. I want to access the DB from java client to be deployed another pod on n/w; here i am unable to get static IP.
Can I create a service with
clusterIP: #some_IP_from_one_of_the_subnet_range# ? What will happen if the service goes down and k8s respawns it? Will it be started in same AZ and subnet? what if AZ is down?