Split-horizon DNS should be configurable for external nodes
General
Escalation
General
Escalation
Description
Environment
None
Activity
Pavel Tankov
October 25, 2024 at 7:20 AM
I verified this bug by creating two namespaces and deploying two mongodb clusters. For deployment 2 I used the following settings:
unmanaged: true
updateStrategy: OnDelete
replsets.expose.enabled: true
sharding.expose.enabled: true
backup. enabled: false
For deployment 1 I used the following settings:
replsets:
- name: rs0
size: 3
externalNodes:
- host: 34.118.233.9
horizons:
external: rs0-0.example.com
votes: 0
priority: 0
- host: 34.118.231.96
horizons:
external: rs0-1.example.com
port: 27017
votes: 0
priority: 0
- host: 34.118.234.246
horizons:
external: rs0-2.example.com
votes: 0
priority: 0
splitHorizons:
my-cluster-name-rs0-0:
external: rs0-0.mycluster.xyz
my-cluster-name-rs0-1:
external: rs0-1.mycluster.xyz
my-cluster-name-rs0-2:
external: rs0-2.mycluster.xyz
expose:
enabled: true
type: ClusterIP
sharding:
enabled: true
configsvrReplSet:
size: 3
externalNodes:
- host: 34.118.234.195
horizons:
external: cfg-0.example.com
votes: 0
priority: 0
- host: 34.118.228.225
horizons:
external: cfg-1.example.com
port: 27017
votes: 0
priority: 0
- host: 34.118.235.138
horizons:
external: cfg-2.example.com
votes: 0
priority: 0
splitHorizons:
my-cluster-name-cfg-0:
external: rs0-0.mycluster.xyz
my-cluster-name-cfg-1:
external: rs0-1.mycluster.xyz
my-cluster-name-cfg-2:
external: rs0-2.mycluster.xyz
expose:
enabled: true
Then I checked the rs.conf()
in the database and the setting was there:
rs.conf()
{
_id: 'rs0',
version: 10,
term: 1,
members: [
{
_id: 0,
host: 'my-cluster-name-rs0-0.my-cluster-name-rs0.psmdb.svc.cluster.local:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 2,
tags: {
podName: 'my-cluster-name-rs0-0',
serviceName: 'my-cluster-name',
nodeName: 'gke-ptankov-default-pool-26780002-dmwv'
},
horizons: { external: 'rs0-0.mycluster.xyz:27017' },
secondaryDelaySecs: Long('0'),
votes: 1
},
{
_id: 1,
host: 'my-cluster-name-rs0-1.my-cluster-name-rs0.psmdb.svc.cluster.local:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 2,
tags: {
nodeName: 'gke-ptankov-default-pool-26780002-c0f9',
podName: 'my-cluster-name-rs0-1',
serviceName: 'my-cluster-name'
},
horizons: { external: 'rs0-1.mycluster.xyz:27017' },
secondaryDelaySecs: Long('0'),
votes: 1
},
{
_id: 2,
host: 'my-cluster-name-rs0-2.my-cluster-name-rs0.psmdb.svc.cluster.local:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 2,
tags: {
podName: 'my-cluster-name-rs0-2',
serviceName: 'my-cluster-name',
nodeName: 'gke-ptankov-default-pool-26780002-vhq4'
},
horizons: { external: 'rs0-2.mycluster.xyz:27017' },
secondaryDelaySecs: Long('0'),
votes: 1
},
{
_id: 3,
host: '34.118.232.198:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 0,
tags: { external: 'true' },
horizons: { external: 'rs0-0.example.com:27017' },
secondaryDelaySecs: Long('0'),
votes: 0
},
{
_id: 4,
host: '34.118.230.147:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 0,
tags: { external: 'true' },
horizons: { external: 'rs0-1.example.com:27017' },
secondaryDelaySecs: Long('0'),
votes: 0
},
{
_id: 5,
host: '34.118.233.121:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 0,
tags: { external: 'true' },
horizons: { external: 'rs0-2.example.com:27017' },
secondaryDelaySecs: Long('0'),
votes: 0
}
],
protocolVersion: Long('1'),
writeConcernMajorityJournalDefault: true,
settings: {
chainingAllowed: true,
heartbeatIntervalMillis: 2000,
heartbeatTimeoutSecs: 10,
electionTimeoutMillis: 10000,
catchUpTimeoutMillis: -1,
catchUpTakeoverDelayMillis: 30000,
getLastErrorModes: {},
getLastErrorDefaults: { w: 1, wtimeout: 0 },
replicaSetId: ObjectId('671aaacdd3d1425fc54ebdcc')
}
}
ege.gunes
October 10, 2024 at 10:21 AM
(edited)
Users can now configure horizons for external nodes:
externalNodes:
- host: 34.124.76.90
horizons:
external: rs0-0.example.com
- host: 34.124.76.91
port: 27017
votes: 0
priority: 0
horizons:
external: rs0-1.example.com
- host: 34.124.76.92
horizons:
external: rs0-2.example.com
Done
Details
Details
Assignee
Pavel Tankov
Pavel Tankov(Deactivated)Reporter
ege.gunes
ege.gunesNeeds QA
Yes
Story Points
1
Sprint
Add sprint
Fix versions
Priority
Created July 31, 2024 at 1:14 PM
Updated November 14, 2024 at 5:21 PM
Resolved October 25, 2024 at 7:20 AM
If one wants to use split-horizon DNS with cross-site replication, they want to perform some manual tasks since replica clusters will be unmanaged and operator won’t configure horizons for them. We need to enable users to configure horizons through main cluster’s cr.yaml.