I have a pod/service running an application that consumes etcd as a synchronization system and datastore. I want to run etcd within the pod, such that all of the replicas form a coherent cluster. In other words, so the application in replica #1 can write "foo" to localhost:4001/v2/keys/my_key
and then replica #2 can then read localhost:4001/v2/keys/my_key
and get "foo" as a result.
It's not clear how this can be done, since pod replicas are not individually addressable. I could in theory create an "etcd" service exposing the cluster ports, but any requests would round-robin to all the replicas so the individual etcd nodes would not be able to find each other.
Am I approaching this problem the correct way?
apiVersion: etcd.coreos.com/v1beta1
andkind: Cluster
, whereas etcd-operator example usesapiVersion: etcd.database.coreos.com/v1beta2
andkind: EtcdCluster
. What are the differences? github.com/coreos/etcd-operator/blob/master/example/… – Fromm