etcd cluster pods are deleted after minikube restart
etcd-operator 0.7.0 macOS 10.13.1 minikube 0.22.0 kubernetes 1.7.5
STR:
- deploy etcd-operator
- create an EtcdCluster (size=3)
- add some keys, get some keys (verify everything is working)
minikube stopminikube start- list pods: all are running, including etcd-operator pod.
- wait a minute, list pods again: all etcd pods are dead, etcd-operator is running (but has restarted once)
- EtcdCluster must be completely deleted and recreated.
I'm trying to find a way to make this less painful, because it's inconvenient during local minikube development to have to recreate the etcd cluster every time my laptop is rebooted or goes through a sleep/wake cycle.
Here is the output of etcd-operator just after minikube starts. It looks like etcd-operator restarts along with minikube (which would make sense, since the VM reboots).
time="2017-11-21T18:47:18Z" level=info msg="etcd-operator Version: 0.7.0"
time="2017-11-21T18:47:18Z" level=info msg="Git SHA: 3bcbdb1"
time="2017-11-21T18:47:18Z" level=info msg="Go Version: go1.9.1"
time="2017-11-21T18:47:18Z" level=info msg="Go OS/Arch: linux/amd64"
time="2017-11-21T18:47:19Z" level=info msg="Event(v1.ObjectReference{Kind:"Endpoints", Namespace:"etcd", Name:"etcd-operator", UID:"d28a270a-c4ac-11e7-9e07-08002743aea9", APIVersion:"v1", ResourceVersion:"2347255", FieldPath:""}): type: 'Normal' reason: 'LeaderElection' etcd-operator-2429849505-64f3g became leader"
time="2017-11-21T18:47:19Z" level=info msg="start running..." cluster-name=etcd-cluster pkg=cluster
time="2017-11-21T18:47:32Z" level=error msg="failed to update members: list members failed: creating etcd client failed: grpc: timed out when dialing" cluster-name=etcd-cluster pkg=cluster
time="2017-11-21T18:47:45Z" level=error msg="failed to update members: list members failed: creating etcd client failed: grpc: timed out when dialing" cluster-name=etcd-cluster pkg=cluster
time="2017-11-21T18:47:53Z" level=warning msg="all etcd pods are dead." cluster-name=etcd-cluster pkg=cluster
time="2017-11-21T18:48:01Z" level=warning msg="all etcd pods are dead." cluster-name=etcd-cluster pkg=cluster
time="2017-11-21T18:48:09Z" level=warning msg="all etcd pods are dead." cluster-name=etcd-cluster pkg=cluster
time="2017-11-21T18:48:17Z" level=warning msg="all etcd pods are dead." cluster-name=etcd-cluster pkg=cluster
I think what happens then is etcd-operator restarts, and when it comes back up, for some reason it decides to purge the running etcd pods. Here's a little recording I did of watch kubectl -n etcd get all (all of my etcd objects are defined in an "etcd" namespace): https://imgur.com/IAVdMfP
You'll notice that the etcd-operator pod goes from restarts=2 to restarts=3, and at that moment, all etcd pods are killed and disappear.
What would be nice is if the etcd pods could be backed by a PersistentVolume. I thought that's what 0.6.1 was doing with backups, but that has been removed in 0.7.0 in favor of EtcdBackup to an S3 bucket? It's unclear to me what the current state of backups/persistence support is.
Let me know if you need more information. Thanks!
For now, etcd pod could not survive node restart. For PV support, please track https://github.com/coreos/etcd-operator/issues/1323 .
I'm closing this to converge in https://github.com/coreos/etcd-operator/issues/1323