Working example for native MongoDB SRV dns resolution in Kubernetes cluster #31971
Replies: 9 comments 45 replies
-
/cc @evanchooly (mongodb), @loicmathieu (mongodb) |
Beta Was this translation helpful? Give feedback.
-
Remove: quarkus.mongodb.native.dns.use-vertx-dns-resolver=true It should now work by default. |
Beta Was this translation helpful? Give feedback.
-
I am testing again with CR1 and I (also) added every host ip from my pods :
Also I don't agree about this issue is about network access.
This is the properties I am using now :
Is it normal not to find any reference to 8.8.8.8 in the logs ? |
Beta Was this translation helpful? Give feedback.
-
Also, in non native mode everything also works ... so again, this is not a network issue ... |
Beta Was this translation helpful? Give feedback.
-
@cescoffier
|
Beta Was this translation helpful? Give feedback.
-
I surrender, for the moment I'll switch back to the old url string format, even if this is not good for an autoscaling microservice deployment. Maybe SRV dns resolution fails only in combination with kubernetes environment. Anyway this is not working for me :( I'll try waiting for this to stop being an experimental feature |
Beta Was this translation helpful? Give feedback.
-
@amoscatelli @cescoffier I'm curious, did you find any solution to this issue? was it an issue at all? I seem to have similar issues, but in a more constrained environment, so reproduction locally is a difficult issue. It's quarkus in Kubernetes and MongoDB atlas that we are having issues with, but not every time. |
Beta Was this translation helpful? Give feedback.
-
Until we find a proper solution to the issue (which is our goal), a temporary workaround is the following: quarkus.naming.enable-jndi=true
quarkus.class-loading.removed-resources."io.quarkus\:quarkus-mongodb-client"=META-INF/services/com.mongodb.spi.dns.DnsClientProvider This means that JNDI will be enabled (which it's not by default in Quarkus) and the Mongo client will use our Mongo DNS resolver. |
Beta Was this translation helpful? Give feedback.
-
#43222 should fix this. It will be available in the next 3.15 release. |
Beta Was this translation helpful? Give feedback.
-
Hi guys !
I am trying to enable the experimental support for SRV address in native mongodb without any success.
I tried enabling the following without any success :
quarkus.mongodb.dns.server-host=8.8.8.8
quarkus.mongodb.native.dns.server-host=8.8.8.8
quarkus.mongodb.native.dns.use-vertx-dns-resolver=true
quarkus.naming.enable-jndi=true
The documentation seems a bit confusing about this, even more quarkus complains about some of those properties :
[io.quarkus.config.build] The 'quarkus.mongodb.native.dns.server-host' config property is deprecated and should not be used anymore
[io.quarkus.config.build] The 'quarkus.mongodb.native.dns.use-vertx-dns-resolver' config property is deprecated and should not be used anymore
Can anybody paste a working properties example ?
Thank you in advance
p.s. I am using Alpha4
Beta Was this translation helpful? Give feedback.
All reactions