connectionString.standard with custom dns kubernetes

I deployed a MongoDB Community instance in a kubernetes environment with a custom dns, mydomain.fr instead of cluster.local.
My problem is that the generated connection string contains cluster.local and not the dns entered in my kubernetes cluster.

I have not found how to make sure that when creating the mongodb cluster, the connection string takes into account my dns (mydomain.fr).
the generated string contains:

mongodb-0.mongodb-svc.mongodb.svc.cluster.local:27017,mongodb-1.mongodb-svc.mongodb.svc.cluster.local:27017,mongodb-2.mongodb-svc.mongodb.svc.cluster.local:27017

It should be:

mongodb-0.mongodb-svc.mongodb.svc.mydomain.fr:27017,mongodb-1.mongodb-svc.mongodb.svc.mydomain.fr:27017,mongodb-2.mongodb-svc.mongodb.svc.mydomain.fr:27017

Except that this dns resolution does not exist within my cluster and the pods are not reachable.
The problem is identical with the standard srv.

Thank you in advance for your assistance.

Hello Frederic,
The configuration options for the community operator when it comes to external domains is limited, but in your case where the cluster domain is mydomain.fr, you could configure it in your operator installation either with your values.yaml file that you use for the helm installation of the operator:

operator:
  extraEnvs:
  - name: CLUSTER_DOMAIN
    value: mydomain.fr

or by setting this environment variable on your community operator deployment.

I hope this helps!

Hi Mircea,

Thanks for your help, I was going around without having the right syntax.
Now my cluster has started well.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.