Giter VIP home page Giter VIP logo

mongo-replicaset-kubernetes-persistent-volumes-example's Introduction

Mongo Replica Set on Kubernetes

nodes

  • 1 Kubernetes master
  • at least 4 Kubernetes minion nodes

Kubernetes spec deployed -3 replication controllers -3 services

Mongo configuration

  • 3 nodes
    • 1 primary

Once a three node Mongo replica set is configured on the Kubernetes nodes

  1. Kill the node running the primary
  2. Mongo schedules a leader election electing one of the secondaries as a new primary
  3. Kubernetes reschedules the old primary onto our 4th Kubernetes minion node.
  4. the newly reestablished replica catches up to the 3 nodes
  5. election happens again if needed.

Mongo database will have to be seeded with an arbitrary 1gb of seeded data to better simulate a production database going through the rescheduling, re-election, and data catch up process.

a few issues needing to work out

  1. how to route writes to newly elected leader with Kubernetes
  2. how to route reads to all replica nodes (if you want to)
  3. how to constrain pods generated by 3 separate replication controllers to separate nodes (resource constraints)
  4. how to configure each new node on first deployment to be setup correctly in the replica set.

How to handle automatic ``rs.initiate(config)setup onkubctl create -f rc.yml'

mongo-replicaset-kubernetes-persistent-volumes-example's People

Contributors

stephenitis avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

lhhl915

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.