1.

Suppose you have to use database with your application but well, if you make a database container-based deployment. how would the data persist?

Answer»

DEPLOYMENTS are for stateless services, you want to use a StatefulSet or just define 3+ pods without a replication controller at all. If you care about stable pod names and volumes, you should go for StatefulSet.Using statefulsets you can maintain which pod is attached to which disk.StatefulSets make vanilla k8s capable of keeping Pod state (THINGS like IPs, etc) which makes it easy to run clustered databases. A stateful set is a controller that orchestrates pods for the desired state. StatefulSets formerly known as PetSets will help for the DATABASE if hosting your own. ESSENTIALLY StatefulSet is for DEALING with applications that inherently don't care about what node they run on, but need unique storage/state.



Discussion

No Comment Found

Related InterviewSolutions