Description
We are trying to use Percona Server for MongoDB Operator in Kubernetes with configured splitHorizons
to allow external clients to connect via OCI Load Balancer.
Our splitHorizons
configuration:
expose:
enabled: true
type: LoadBalancer
serviceAnnotations:
oci.oraclecloud.com/load-balancer-type: lb
service.beta.kubernetes.io/oci-load-balancer-internal: 'true'
service.beta.kubernetes.io/oci-load-balancer-shape: flexible
service.beta.kubernetes.io/oci-load-balancer-shape-flex-max: '1000'
service.beta.kubernetes.io/oci-load-balancer-shape-flex-min: '100'
service.beta.kubernetes.io/oci-load-balancer-subnet1: ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaap6bdzaxslyz6m54ow2kq62mno3r44a3zvq6scxs2ozm3zbtafw6a
splitHorizons:
hybrid-cluster-rs0-0:
external: dev-oci-lb09.pbu.icb
hybrid-cluster-rs0-1:
external: dev-oci-lb10.pbu.icb
hybrid-cluster-rs0-2:
external: dev-oci-lb11.pbu.icb
In rs.conf()
, we can see that horizons
are correctly set:
{
"_id": "rs0",
"members": [
{
"_id": 0,
"host": "hybrid-cluster-rs0-0.hybrid-cluster-rs0.mongodb-percona.svc.cluster.local:27017",
"horizons": { "external": "dev-oci-lb09.pbu.icb:27017" }
},
{
"_id": 1,
"host": "hybrid-cluster-rs0-1.hybrid-cluster-rs0.mongodb-percona.svc.cluster.local:27017",
"horizons": { "external": "dev-oci-lb10.pbu.icb:27017" }
},
{
"_id": 2,
"host": "hybrid-cluster-rs0-2.hybrid-cluster-rs0.mongodb-percona.svc.cluster.local:27017",
"horizons": { "external": "dev-oci-lb11.pbu.icb:27017" }
}
]
}
ERROR
However, when connecting via mongosh using the connection string:
mongosh "mongodb://dev-oci-lb09.pbu.icb,dev-oci-lb10.pbu.icb,dev-oci-lb11.pbu.icb/?replicaSet=rs0"
Current Mongosh Log ID: 67ebe09d391aa73ff86b140a
Connecting to: mongodb://dev-oci-lb09.pbu.icb,dev-oci-lb10.pbu.icb,dev-oci-lb11.pbu.icb/?replicaSet=rs0&appName=mongosh+2.4.2
MongoNetworkError: getaddrinfo ENOTFOUND hybrid-cluster-rs0-0.hybrid-cluster-rs0.mongodb-percona.svc.cluster.local
This indicates that mongosh ignores horizons
and tries to connect using internal Kubernetes DNS names.
Thank you for your help!