Open achar007 opened 1 week ago
Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.
Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.
following change would help fixing this issue, I appreciate if maintainers can review this change in _helpers.tpl
{{/*
Get initial primary host to configure MongoDB cluster.
*/}}
{{- define "mongodb.initialPrimaryHost" -}}
{{- if contains "arbiter" (include "mongodb.fullname" .) -}}
{{/* Use the service name of the first pod in the MongoDB StatefulSet when this is the arbiter */}}
{{ ternary
( printf "%s-0.%s-headless.$(MY_POD_NAMESPACE).svc.%s"
(include "mongodb.fullname" . | replace "arbiter" "")
(include "mongodb.fullname" . | replace "arbiter" "")
.Values.clusterDomain )
( first .Values.externalAccess.service.publicNames )
( empty .Values.externalAccess.service.publicNames )
}}
{{- else -}}
{{/* Use the standard service name for MongoDB secondaries or primary */}}
{{ ternary
( printf "%s-0.$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.%s"
(include "mongodb.fullname" .)
.Values.clusterDomain )
( first .Values.externalAccess.service.publicNames )
( empty .Values.externalAccess.service.publicNames )
}}
{{- end -}}
{{- end -}}
Name and Version
bitnami/mongodb
What architecture are you using?
amd64
What steps will reproduce the bug?
helm -n mongo-ha1 install my-mongo-ha1 bitnami/mongodb -f values-mon-ha1.yml
Are you using any custom parameters or values?
Here are my values.yml
What is the expected behavior?
This is missing the arbiter node.
What do you see instead?
It is missing out arbiter node in
rs.status()
output moreover arbiter is trying to connect to fqdn of node name which is incorrect...env variable
MONGODB_INITIAL_PRIMARY_HOST
on arbiter node and secondary should be different as their headless service name is differentThe actual value of
MONGODB_INITIAL_PRIMARY_HOST
on arbiter is supposed to bemy-mongo-ha1-mongodb-0.my-mongo-ha1-mongodb-headless.mongo-ha1.svc.cluster.local
somewhere it's getting modified to use the local service name on the arbiter which is incorrect and hence container restarted and not able to add to replicaset.