Re:Teaching Kubernetes
by gtirloni on Sunday February 19, 2017 @03:17PM
(#13681742)
Without Stateful Sets, or a replication controller, doesn't it mean that if my host dies, the DB won't get started anywhere? Who's managing where that pod should spawn next (with its associated storage)?
[ Parent
| on HN ]
Re:Teaching Kubernetes
by lobster_johnson on Sunday February 19, 2017 @03:29PM
(#13681804)
Right, I simplified a bit there: You would use a replication controller, but it would have "replicas: 1". This way, the pod is rescheduled and the service repointed, and the volume management ensures that the database gets mounted.
Got it, thanks!
Re:Teaching Kubernetes
by smarterclayton on Sunday February 19, 2017 @06:55PM
(#13683027)
Note that replicas: 1 does not actually guarantee "at most 1". If you have block storage with locks (AWS/gce/ceph/cinder), then he second replica won't start until the first is gone. If you try to use "replicas: 1" with a shared filesystem you can have 2 pods running against that filesystem at once.
StatefulSets guarantees "at most one"
Re:Teaching Kubernetes
by lobster_johnson on Sunday February 19, 2017 @07:20PM
(#13683170)
That's solved by setting "strategy.type" to "Recreate", isn't it? This will disable rolling deploys. The replication controller wouldn't then attempt to have two pods running at the same time.