title: replica set config is invalid or we are not a member of it, running in kubernetes
body: <p>I have posted this problem from <a href="https://github.com/kubernetes/kubernetes/issues/4825#issuecomment-153567540" rel="noreferrer">here</a></p>
  
  <p>I am running sharded mongodb in a kubernetes environment, with 3 shards, and 3 instances on each shard. for some reasons, my mongodb instance have been rescheduled to another machine.</p>
  
  <p>the problem is when a mongodb instance have ben rescheduled to another instance, its <code>replica config</code> will be invalidated. resulting to this error  below.</p>
  
  <pre><code>            &gt; rs.status()
              {
                  "state" : 10,
                  "stateStr" : "REMOVED",
                  "uptime" : 2110,
                  "optime" : Timestamp(1448462710, 6),
                  "optimeDate" : ISODate("2015-11-25T14:45:10Z"),
                  "ok" : 0,
                  "errmsg" : "Our replica set config is invalid or we are not a member of it",
                  "code" : 93
              }
              &gt;
  </code></pre>
  
  <p>this is the config</p>
  
  <pre><code>            &gt; rs.config().members
              [
                  {
                      "_id" : 0,
                      "host" : "mongodb-shard2-service:27038",
                      "arbiterOnly" : false,
                      "buildIndexes" : true,
                      "hidden" : false,
                      "priority" : 1,
                      "tags" : {
  
                      },
                      "slaveDelay" : 0,
                      "votes" : 1
                  },
                  {
                      "_id" : 1,
                      "host" : "shard2-slave2-service:27039",
                      "arbiterOnly" : false,
                      "buildIndexes" : true,
                      "hidden" : false,
                      "priority" : 1,
                      "tags" : {
  
                      },
                      "slaveDelay" : 0,
                      "votes" : 1
                  },
                  {
                      "_id" : 2,
                      "host" : "shard2-slave1-service:27033",
                      "arbiterOnly" : false,
                      "buildIndexes" : true,
                      "hidden" : false,
                      "priority" : 1,
                      "tags" : {
  
                      },
                      "slaveDelay" : 0,
                      "votes" : 1
                  }
              ]
  </code></pre>
  
  <p>and a sample of  <code>db.serverStatus()</code> of a rescheduled mongodb instance</p>
  
  <pre><code>            &gt; db.serverStatus()
              {
                  "host" : "mongodb-shard2-master-ofgrb",
                  "version" : "3.0.7",
                  "process" : "mongod",
                  "pid" : NumberLong(8),
  </code></pre>
  
  <p>I hope I am making sense.. because, I will be using this in live production very soon.. thank you!!</p>